Skip to content

feat(upload-cdk-source): run on the node24 runtime, implemented in TypeScript - #270

Merged
joakimen merged 1 commit into
masterfrom
feat/upload-cdk-source-typescript
Sep 15, 2026
Merged

joakimen merged 1 commit into
masterfrom
feat/upload-cdk-source-typescript

Conversation

@joakimen

@joakimen joakimen commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Moves the action to the node24 runtime. Selects the CDK application's files, archives them with fflate and uploads with the AWS SDK, replacing a find | grep | zip pipeline and the aws CLI.

Unit tests now cover which files are selected and the metadata the pipeline reads.

Stacked on #267, which adds the shared archive and S3 modules this uses.

Comment thread lib/archive.ts
export const zipPaths = (
root: string,
names: readonly string[],
): Result<Uint8Array> => archive(root, names.map((name) => join(root, name)))

@aikido-pr-checks aikido-pr-checks Bot Sep 11, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential file inclusion attack via reading file - high severity
If an attacker can control the input leading into the ReadFile function, they might be able to read sensitive files and launch further attacks with that information.

Show fix
Suggested change
): Result<Uint8Array> => archive(root, names.map((name) => join(root, name)))
): Result<Uint8Array> => {
const resolvedRoot = path.resolve(root);
const validatedPaths = names.map((name) => {
const target = path.resolve(resolvedRoot, name);
const relative = path.relative(resolvedRoot, target);
if (relative.startsWith('..') || path.isAbsolute(relative)) {
throw new Error('Invalid path');
}
return target;
});
return archive(root, validatedPaths);
}

Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AikidoSec ignore: reads a path the workflow author supplies, who already has code execution in the job;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Based on your feedback, we ignored this issue because of the following reason:

reads a path the workflow author supplies, who already has code execution in the job;

@joakimen
joakimen force-pushed the feat/upload-cdk-source-typescript branch from db64e35 to 6f0d767 Compare September 11, 2026 11:17
@joakimen
joakimen force-pushed the feat/upload-s3-artifact-typescript branch from 9ed80ed to 5efc16c Compare September 15, 2026 09:45
@joakimen
joakimen force-pushed the feat/upload-cdk-source-typescript branch from 6f0d767 to b10e5e5 Compare September 15, 2026 09:46
@joakimen
joakimen force-pushed the feat/upload-cdk-source-typescript branch from 81a09af to 9ace52b Compare September 15, 2026 10:01
@joakimen
joakimen force-pushed the feat/upload-cdk-source-typescript branch from 9ace52b to 6fbc724 Compare September 15, 2026 10:06
@joakimen
joakimen force-pushed the feat/upload-s3-artifact-typescript branch from 5efc16c to ea2b56b Compare September 15, 2026 10:12
@joakimen
joakimen force-pushed the feat/upload-cdk-source-typescript branch from 6fbc724 to e8fb430 Compare September 15, 2026 10:12
@joakimen
joakimen force-pushed the feat/upload-s3-artifact-typescript branch from ea2b56b to 115266d Compare September 15, 2026 10:26
@joakimen
joakimen force-pushed the feat/upload-cdk-source-typescript branch from e8fb430 to 9ec38cc Compare September 15, 2026 10:26
@joakimen
joakimen force-pushed the feat/upload-s3-artifact-typescript branch 2 times, most recently from 142601d to 178538b Compare September 15, 2026 10:43
…peScript

Selects, archives and uploads the CDK source with fflate and the AWS SDK,
replacing a find-grep-zip pipeline and the aws CLI. Which files are selected
was a grep alternation and is now a tested function.

test.sh carries the workflow test beside the action's unit tests. It asserts
what the archive holds, not only that it uploaded: an archive carrying
node_modules would upload and report success just the same.

Inputs, outputs and the metadata file's fields are unchanged.
@joakimen
joakimen force-pushed the feat/upload-cdk-source-typescript branch from 9ec38cc to 89a8d3d Compare September 15, 2026 10:44
Base automatically changed from feat/upload-s3-artifact-typescript to master September 15, 2026 11:18
@joakimen
joakimen merged commit b1dd8b4 into master Sep 15, 2026
4 checks passed
@joakimen
joakimen deleted the feat/upload-cdk-source-typescript branch September 15, 2026 11:20
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.16.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant