Skip to content

Update actions to use versions that use Node v24#3451

Open
kevinb-khan wants to merge 3 commits intomainfrom
fei-7601
Open

Update actions to use versions that use Node v24#3451
kevinb-khan wants to merge 3 commits intomainfrom
fei-7601

Conversation

@kevinb-khan
Copy link
Copy Markdown
Collaborator

@kevinb-khan kevinb-khan commented Apr 2, 2026

Summary:

GitHub Actions will no longer be supporting the use of Node v20 in workflow and actions on April 24. That means we need to make sure all workflows and actions are using Node v24 before then.

This PR also includes a script which we use in some of our other repos to keep the SHAs for actions up to date. It updated the SHA based on the version in the comment that comes after it.

Issue: FEI-7601

Test plan:

  • let CI run all jobs and verify that there are no Node v20 warnings
Screenshot 2026-04-02 at 3 03 07 PM

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

🗄️ Schema Change: No Changes ✅

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Size Change: 0 B

Total Size: 495 kB

ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 20.5 kB
packages/keypad-context/dist/es/index.js 1 kB
packages/kmath/dist/es/index.js 6.21 kB
packages/math-input/dist/es/index.js 98.5 kB
packages/math-input/dist/es/strings.js 1.61 kB
packages/perseus-core/dist/es/index.item-splitting.js 11.9 kB
packages/perseus-core/dist/es/index.js 25.1 kB
packages/perseus-editor/dist/es/index.js 102 kB
packages/perseus-linter/dist/es/index.js 9.3 kB
packages/perseus-score/dist/es/index.js 9.66 kB
packages/perseus-utils/dist/es/index.js 403 B
packages/perseus/dist/es/index.js 193 kB
packages/perseus/dist/es/strings.js 8.09 kB
packages/pure-markdown/dist/es/index.js 1.39 kB
packages/simple-markdown/dist/es/index.js 6.71 kB

compressed-size-action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

🛠️ Item Splitting: No Changes ✅

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

npm Snapshot: Published

Good news!! We've packaged up the latest commit from this PR (f43015f) and published it to npm. You
can install it using the tag PR3451.

Example:

pnpm add @khanacademy/perseus@PR3451

If you are working in Khan Academy's frontend, you can run the below command.

./dev/tools/bump_perseus_version.ts -t PR3451

If you are working in Khan Academy's webapp, you can run the below command.

./dev/tools/bump_perseus_version.js -t PR3451

@kevinb-khan kevinb-khan marked this pull request as ready for review April 2, 2026 19:03
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@kevinb-khan kevinb-khan requested a review from a team April 2, 2026 19:06
Copy link
Copy Markdown
Collaborator

@jeremywiebe jeremywiebe left a comment

Choose a reason for hiding this comment

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

Actual workflow changes are great.

With regards to the script, I have several comments and one more, in general. Will this be something we want to bake in to wonder-stuff as a pnpm dlx-able tool like we did for wonder-stuff-tool-new-pkg?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could we upgrade this to be a .ts script using swc? We do that in other scripts in this dir and it at least gives us some type safety.


// Collect unique action+ref pairs across all files

const seen = new Map(); // key: "action@ref" → resolved SHA (filled later)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Although not entirely necessary, I find moving the contents of the script body into a main function useful so that it's easy to scan the script to see what all does. This script also feels like it could use some functions extracted for the steps it takes.

run_install: false

- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Was this missed or does it not need to be bumped? The latest version is 6.3.0.

Image

Comment on lines +2 to +5
* Scan all workflow and action YAML files for GitHub Action references and
* ensure they are pinned to commit SHAs. Handles two cases:
* 1. Already pinned (`uses: owner/repo@<sha> # <tag>`) — updates stale SHAs
* 2. Unpinned (`uses: owner/repo@<tag>`) — replaces with `@<sha> # <tag>`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

When you say "stale", does this mean "not latest" or something else? ie. Is this an upgrade script or just one that transforms our workflow yaml file to all have SHA-pinned actions references?


const allRepos = new Set(); // all unique owner/repo names (for listing)

for (const file of files) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

These loops all feel like they'd be handy to have in functions so the steps of this script are easier to digest.

.sort();
console.log("Allowed actions:\n");
for (const repo of uniqueRepos) {
console.log(`${repo}@*,`);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: Can we indent this repo listing and make it a "bulleted" list?

Suggested change
console.log(`${repo}@*,`);
console.log(` - ${repo}@*,`);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Alternately, we could use console.group() and console.groupEnd(). 🤷‍♂️

.sort();
console.log("Allowed actions:\n");
for (const repo of uniqueRepos) {
console.log(`${repo}@*,`);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also, since the workflow yml files reference actions as repo/name, would we be more clear with this listing if we used:

console.log(`${repo}/*`);

encoding: "utf-8",
}).trim();

if (branchOutput) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think if we fall back to a branch ref, the might want to warn. I guess we will still have the changes in the repo to review through normal git workflows... but it feels worth warning about.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants