Repository navigation
ci: pin actions to commit SHAs, least-privilege permissions, cross-platform matrix - #7
Open
AjayBThorat-20 wants to merge 2 commits into
Open
AjayBThorat-20 wants to merge 2 commits into
AjayBThorat-20 wants to merge 2 commits into
Conversation
…atform matrix - Pin every action to a full commit SHA (with its version as a comment) and set persist-credentials: false on checkouts. - Default workflow permissions to contents: read; jobs request only what they need. - Test on ubuntu/macos/windows x Node 20/22/24. Windows is informational (continue-on-error) until npm spawning and the grep-based unused fallback work there. - release.yml: publish via npm trusted publishing (OIDC, with provenance) instead of a long-lived NPM_TOKEN, and create the GitHub Release from the CHANGELOG automatically. - Move create-test-projects.sh into test/ and tidy .gitignore.
Its cleanup step removes everything under test/ except unit/ and integration/. Now that the script itself lives in test/, it deleted its own tracked file every time it ran (unnoticed in CI, where the checkout is thrown away, but it wiped the file from a local working tree).
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Hardens the workflows, following OpenSSF Scorecard recommendations:
persist-credentials: false.contents: read; each job asks only for what it needs.continue-on-errorfor now;fix/windows-support(fix: make fix and the unused-dependency fallback work on Windows #12) makes it pass, after which that flag can go.release.ymlpublishes through npm trusted publishing (OIDC, with provenance) instead of a long-livedNPM_TOKEN, and creates the GitHub Release from the CHANGELOG.create-test-projects.shmoves intotest/(and no longer deletes itself in its cleanup step).Stacked on #5.
Merging the stack: use Create a merge commit, not squash (squashing makes every later PR show these commits again). After merging the PR below this one, click Delete branch on it; GitHub then retargets this PR to
mainand CI runs.How I tested it
npm run test:coverageon Node 24.21.0, cleannpm ci, network disabled: 88/88 pass, 63.94% linesnpm audit --audit-level=highcurrently fails on GHSA-mrwp-f3q8-3g9p (follow-redirects, published after this branch was made); the lockfile fix is in feat: rank vulnerabilities by exploit risk (CISA KEV + FIRST EPSS) #14🤖 Generated with Claude Code