ci: disable persisted credentials and correct action version pin comments - #445
Merged
Conversation
Set `persist-credentials: false` on every `actions/checkout` step in the CD, CI and dependency-check workflows, so the GitHub token is not left behind in the local Git config while repository-controlled npm commands run. This shortens the window in which the workflow token is available to build and packaging steps. All affected jobs are read-only: none push, tag, or otherwise use the persisted credentials, and both `permissions:` blocks are already `contents: read`. The qlty job keeps `fetch-depth: 0` (credentials are only dropped after the fetch), and the drift check's `git diff` is a purely local operation, so checkout behaviour is otherwise unchanged. `.github/workflows/e2e.yml` already set the flag and is left untouched. Closes #444 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01129DHTrr8BrrnBCaiLVzYv
Contributor
📝 WalkthroughWalkthroughThe CI, dependency, package, and E2E workflows update GitHub Actions references. Affected checkout steps set Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (3 passed)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #445 +/- ##
===========================
===========================
🚀 New features to boost your workflow:
|
tkislan
marked this pull request as ready for review
July 20, 2026 09:35
m1so
previously approved these changes
Jul 20, 2026
m1so
left a comment
Contributor
There was a problem hiding this comment.
LGTM ✅
(although there are now merge conflicts)
m1so
previously approved these changes
Jul 20, 2026
Resolved conflicts in the checkout steps of cd.yml, ci.yml and deps.yml: main bumped actions/checkout 7.0.0 -> 7.0.1 while this branch added persist-credentials: false. Kept main's newer pin plus the setting. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YFmRiqkZebrHeTBTHdwV3z
The `# vX` comments next to SHA-pinned actions had drifted from the SHAs they annotate: every actions/checkout and actions/setup-node pin was commented `# v6` while the SHA was already v7.x. Resolve each pinned SHA against the GitHub tags API and write the full version it corresponds to. Also repin qltysh/qlty-action/install to v2.3.0 (08a0a862). Its previous SHA was an untagged main-branch commit, so no accurate version comment was possible - and that is why its bot PRs are titled `bump qltysh/qlty-action` with no version numbers, unlike every other action here. Back on a release tag, it can be tracked by version again. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YFmRiqkZebrHeTBTHdwV3z
m1so
approved these changes
Jul 28, 2026
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.
Closes #444
Summary
Two related hardening/hygiene changes to the GitHub Actions workflows:
persist-credentials: falseon everyactions/checkoutstep, so the GitHub token is not written into the local Git config while repository-controlled npm commands (npm ci,npm install,npm run package,npx better-npm-audit, …) run in those jobs.Follow-up to the review comment on #422 (discussion_r3613084710).
1. Disable persisted credentials
.github/workflows/cd.ymlpackage).github/workflows/ci.ymllint,typecheck,qlty,build,check_licenses,spell-check,package-lock-drift-check,audit-prod,audit-all).github/workflows/deps.ymlaudit,check-deps).github/workflows/e2e.ymlWhy this is safe
Every affected job is read-only — none pushes, tags, or otherwise consumes the persisted credentials, and each workflow's
permissions:block is alreadycontents: read. Two jobs touch git and were checked specifically:qltykeeps itsfetch-depth: 0.persist-credentials: falseonly strips the auth header after the fetch completes, so full history is still cloned.package-lock-drift-checkrunsgit diff --exit-code HEAD, a purely local operation that needs no credentials.2. Correct the action version comments
The
# vXcomments next to the SHA-pinned actions no longer matched the SHAs. Most visibly, everyactions/checkoutandactions/setup-nodepin was commented# v6while the SHA was already v7.x — the bots had bumped the hashes but the comments were left behind, so the pins read as several majors out of date at a glance.Each pinned SHA was resolved against the GitHub tags API and the comment rewritten to the full version it actually corresponds to:
actions/checkout# v6❌# v7.0.1actions/setup-node# v6❌# v7.0.0codecov/codecov-action# v7(partial)# v7.0.0actions/upload-artifact# v7.0.1✅# v7.0.1actions/setup-python# v7.0.0✅# v7.0.0actions/cache# v6.1.0✅# v6.1.0qltysh/qlty-action/install# v2.3.027 comments corrected in total (13
checkout+ 12setup-node+ 2codecov-action). For all of these the pinned SHA is untouched; only the trailing comment changed, so nothing about what CI executes is different.codecov/codecov-action@fb8b3582carries both thev6.0.2andv7.0.0tags on the same commit;v7.0.0was used, matching what Dependabot bumped it to in #408.The one functional change:
qltysh/qlty-action/installThis was the only pin that could not simply be re-commented. Its SHA
141b8812is not a release — it is an ordinary commit on the action'smainbranch, 11 commits afterv2.2.0and 4 commits short ofv2.2.1. There was no accurate version to write.That is also why its bot PRs are titled a bare
bump qltysh/qlty-actionwith no version numbers, unlike the version-bearingbump actions/checkout from 6.0.2 to 7.0.0: when a SHA-pinned action does not map to a release, Dependabot/Renovate fall back to tracking the branch-head digest. Tracing every pin this repo has held for it shows the drift is self-perpetuating — it sat onv1, thenv2.2.0, then fell onto an untagged commit and stayed there for 8 consecutive bumps.It is now pinned to
08a0a862= v2.3.0, the latest release, so it can be tracked by version again like every other action here. This is the only change in the PR that alters what CI runs.Merge with
mainmainbumpedactions/checkout7.0.0 → 7.0.1 (#447) while this branch was open, which conflicted with thepersist-credentials: falseadditions in 11 checkout steps. Resolved in favour of main's newer pin plus this branch's setting — no checkout version was rolled back.Verification
persist-credentials: false(12 added here + 1 pre-existing ine2e.yml).prettier --check '.github/workflows/*.yml'passes —.github/**/*.ymlis covered bynpm run formatin CI.Acceptance criteria
actions/checkoutstep in the affected workflows setspersist-credentials: false..github/workflows/e2e.ymlremains unchanged (its checkout gains only a corrected version comment).🤖 Generated with Claude Code
https://claude.ai/code/session_01YFmRiqkZebrHeTBTHdwV3z
Summary by CodeRabbit
Security
Chores