Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f05af87
fix: update Node.js version to 24.x in workflow
scottschreckengaust Apr 13, 2026
fa83867
fix: update GitHub Actions to use Node.js 24 and latest actions
scottschreckengaust Apr 13, 2026
7a9895b
fix: Bump version from 1.0.4 to 1.0.20 (next release)
scottschreckengaust Apr 13, 2026
c12a765
fix: update version of @aws-actions/codebuild-run-build
scottschreckengaust Apr 13, 2026
9b70486
fix: downgrade @actions/github to ^8.0.1 for CJS compatibility
scottschreckengaust Apr 13, 2026
d76431b
fix: upgrade mocha from ^10.1.0 to ^11.7.5
scottschreckengaust Apr 13, 2026
7c0ebe6
fix: resolve npm audit findings via overrides and dependency updates
scottschreckengaust Apr 13, 2026
274cf2f
docs: add ESM migration plan
scottschreckengaust Apr 13, 2026
e30c84e
feat: convert project from CommonJS to ESM
scottschreckengaust Apr 13, 2026
968446d
fix: replace ncc with esbuild for single-file ESM bundle
scottschreckengaust Apr 13, 2026
eeb154c
refactor: inject context into githubInputs() for testability
scottschreckengaust Apr 13, 2026
1f62c38
ci: test against Node.js 22 and 24 matrix
scottschreckengaust Apr 13, 2026
ac22d61
chore: remove ESM migration plan
scottschreckengaust Apr 13, 2026
8f3be0c
feat: migrate ESLint to v10 flat config
scottschreckengaust Apr 14, 2026
31f2e91
chore: upgrade all outdated dependencies
scottschreckengaust Apr 14, 2026
78c4e20
chore: remove unused @actions/exec dependency
scottschreckengaust Apr 14, 2026
f0c3563
chore: update publish workflow to checkout@v6, fix ncc reference in R…
scottschreckengaust Apr 14, 2026
7a9249e
docs: simplify Running Locally section in README
scottschreckengaust Apr 14, 2026
85aea28
chore: narrow files field to dist and action.yml
scottschreckengaust Apr 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .eslintrc.json

This file was deleted.

10 changes: 6 additions & 4 deletions .github/workflows/ci-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ jobs:
permissions:
contents: read
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22, 24]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
# This should match the using value in `actions.yaml`
node-version: 20
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run lint
- run: npm run test
8 changes: 4 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
ref: ${{ github.event.release.tag_name }}
- name: Use node.js 20.x
uses: actions/setup-node@v4
- name: Use node.js 24.x
uses: actions/setup-node@v6
with:
node-version: 20
node-version: 24
- name: NPM Install
run: npm ci
- name: Check Format
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lint-staged
26 changes: 7 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,33 +277,21 @@ this will overwrite them.
### Running Locally

It can be useful to run a build outside of CI.
So, this action can also be installed locally
to kick off a CodeBuild project from your git sandbox.
You could push your changes to an open PR,
but if you only want to test one project this may be faster.
In order to use this tool,
you must first `git checkout` the commit that you want to test.
This action can be installed locally to kick off a CodeBuild project from your git sandbox.
You must first `git checkout` the commit that you want to test.

```
npx github:aws-actions/aws-codebuild-run-build -p ProjectName -r remoteName
```

Note: If the above command returns a 404 error, you might need to add the package manually.

```
npm install git@github.com:aws-actions/aws-codebuild-run-build.git
# OR
yard add git@github.com:aws-actions/aws-codebuild-run-build.git
git clone git@github.com:aws-actions/aws-codebuild-run-build.git
cd aws-codebuild-run-build
npm ci
node local.js -p ProjectName -r remoteName
```

This will use whatever commit you have checked out
and push to a temporary branch in the specified remote.
Then kick off the build
and delete the remote branch when complete.

You can also install the project globally or locally
and execute it that way.

## Implementation Notes

### What we did
Expand Down Expand Up @@ -354,7 +342,7 @@ If you find that these options don't meet your needs, please open an issue to le

By creating a new Release a workflow is triggered creating a new commit which only contains `dist` and the `action.yml`. The necessary tags, i.e. for the release v1.0.7, the tag v1.0.7 is created and the v1.0 and v1 tags are updated.

For the tagging and building the [build-and-tag](https://github.com/JasonEtco/build-and-tag-action) action by [Jason Etcovitch](https://github.com/JasonEtco) is used. It expects to have the main attribute and a build script to be set in the `package.json`. It then builds the code with the ncc compiler and creates the new tag/ updates existing tags for minor and major versions automatically.
For the tagging and building the [build-and-tag](https://github.com/JasonEtco/build-and-tag-action) action by [Jason Etcovitch](https://github.com/JasonEtco) is used. It expects to have the main attribute and a build script to be set in the `package.json`. It then builds the code with esbuild and creates the new tag/ updates existing tags for minor and major versions automatically.

## License

Expand Down
38 changes: 19 additions & 19 deletions code-build.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

const core = require("@actions/core");
const github = require("@actions/github");
const { CloudWatchLogs } = require("@aws-sdk/client-cloudwatch-logs");
const { CodeBuild } = require("@aws-sdk/client-codebuild");
const assert = require("assert");
import * as core from "@actions/core";
import * as github from "@actions/github";
import { CloudWatchLogs } from "@aws-sdk/client-cloudwatch-logs";
import { CodeBuild } from "@aws-sdk/client-codebuild";
import assert from "node:assert";

module.exports = {
export {
runBuild,
build,
waitForBuildEndTime,
Expand Down Expand Up @@ -73,7 +73,7 @@ async function waitForBuildEndTime(
seqEmptyLogs,
totalEvents,
throttleCount,
nextToken
nextToken,
) {
const { codeBuild, cloudWatchLogs } = sdk;

Expand Down Expand Up @@ -114,7 +114,7 @@ async function waitForBuildEndTime(
if (errObject.message && errObject.message.search("Rate exceeded") !== -1) {
// We were rate-limited, so add backoff with Full Jitter, ref: https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
let jitteredBackOff = Math.floor(
Math.random() * (updateBackOff * 2 ** throttleCount)
Math.random() * (updateBackOff * 2 ** throttleCount),
);
let newWait = updateInterval + jitteredBackOff;
throttleCount++;
Expand All @@ -130,7 +130,7 @@ async function waitForBuildEndTime(
seqEmptyLogs,
totalEvents,
throttleCount,
nextToken
nextToken,
);
} else {
//The error returned from the API wasn't about rate limiting, so throw it as an actual error and fail the job
Expand Down Expand Up @@ -170,8 +170,8 @@ async function waitForBuildEndTime(
resolve,
current.endTime && throttleCount == 0
? updateInterval / 2
: updateInterval
)
: updateInterval,
),
);

// Try again
Expand All @@ -182,16 +182,16 @@ async function waitForBuildEndTime(
seqEmptyLogs,
totalEvents,
throttleCount,
nextForwardToken
nextForwardToken,
);
}

function githubInputs() {
function githubInputs(ctx = github.context) {
const projectName = core.getInput("project-name", { required: true });
const disableSourceOverride =
core.getInput("disable-source-override", { required: false }) === "true";
const { owner, repo } = github.context.repo;
const { payload } = github.context;
const { owner, repo } = ctx.repo;
const { payload } = ctx;
// The github.context.sha is evaluated on import.
// This makes it hard to test.
// So I use the raw ENV.
Expand Down Expand Up @@ -239,12 +239,12 @@ function githubInputs() {
const updateInterval =
parseInt(
core.getInput("update-interval", { required: false }) || "30",
10
10,
) * 1000;
const updateBackOff =
parseInt(
core.getInput("update-back-off", { required: false }) || "15",
10
10,
) * 1000;

const hideCloudWatchLogs =
Expand Down Expand Up @@ -328,7 +328,7 @@ function inputs2Parameters(inputs) {
.filter(
([key]) =>
(!disableGithubEnvVars && key.startsWith("GITHUB_")) ||
envPassthrough.includes(key)
envPassthrough.includes(key),
)
.map(([name, value]) => ({ name, value, type: "PLAINTEXT" }));

Expand Down Expand Up @@ -363,7 +363,7 @@ function buildSdk() {
) {
assert(
codeBuild.config.credentials && cloudWatchLogs.config.credentials,
"No credentials. Try adding @aws-actions/configure-aws-credentials earlier in your job to set up AWS credentials."
"No credentials. Try adding @aws-actions/configure-aws-credentials earlier in your job to set up AWS credentials.",
);
}

Expand Down
Loading