Skip to content

ci: keep write tokens away from third-party code - #123

Merged
michen00 merged 3 commits into
mainfrom
ci/pin-writer-actions
Oct 28, 2026
Merged

michen00 merged 3 commits into
mainfrom
ci/pin-writer-actions

Conversation

@michen00

@michen00 michen00 commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two workflows let third-party code run beside a write token. changelog-autoupdate.yml installed git-cliff and markdownlint in the job that opens the pull request, and the actions that write to the repository floated on major tags. This moves the changelog build to a read-only job and pins each action that holds a write token to a commit.

Changes

  • changelog-autoupdate.yml: one job becomes two. generate installs git-cliff and markdownlint and rebuilds CHANGELOG.md under a read-only token, with no credentials persisted by checkout, then uploads the file. pull-request holds contents and pull-requests write and runs only checkout, download-artifact and create-pull-request. The id-token: write grant goes, since no step requests an OIDC token.
  • Pinned to the commit their major tag points to today:
    • crazy-max/ghaction-import-gpg in release-publish.yml and release-tag.yml, pinned to 2dc316d (v7.0.0). It imports the release signing key in jobs that hold contents write.
    • peter-evans/create-pull-request in release-pr.yml and changelog-autoupdate.yml, pinned to 5f6978f (v8.1.1).
    • iarekylew00t/verified-bot-commit in pre-commit-autoupdate.yml, pinned to 1ee4374 (v2.3.6).

A major tag such as @v8 can be moved to any commit, and the next run executes whatever it points to with that token. Every other action still floats on its major, so this adds no Dependabot pull requests for actions that cannot write. Dependabot updates each pinned commit and its # vX.Y.Z comment like any other version, under the same schedule and 30-day cooldown.

Testing

🤖 Generated with Claude Code

michen00 and others added 2 commits October 27, 2026 20:32
Pin each third-party action that runs with a write token to the commit
its major tag points to today: peter-evans/create-pull-request,
iarekylew00t/verified-bot-commit, softprops/action-gh-release,
googleapis/release-please-action and crazy-max/ghaction-import-gpg,
wherever this repository uses them. A major tag can be moved to any
commit, and these actions write to the repository or handle the
release signing key. Every other action still floats on its major.

Dependabot updates the commit and its version comment, and its
cooldown applies to these updates as to any other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Split changelog-autoupdate.yml into two jobs. `generate` installs
git-cliff and markdownlint, regenerates CHANGELOG.md under a read-only
token with no persisted credentials, and uploads the file. The
`pull-request` job, which holds contents and pull-requests write, runs
only checkout, download-artifact and create-pull-request, pinned to a
commit. The id-token grant goes, since no step requests an OIDC token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 50.23%. Comparing base (a6cb6e4) to head (c0d47d7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #123   +/-   ##
=======================================
  Coverage   50.23%   50.23%           
=======================================
  Files          33       33           
  Lines        2598     2598           
=======================================
  Hits         1305     1305           
  Misses       1293     1293           
Flag Coverage Δ
integration 0.73% <ø> (ø)
unit 49.74% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Repository owner deleted a comment from qodo-code-review Bot Oct 28, 2026
The `# vX.Y.Z` after each pinned commit stays; Dependabot reads it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michen00
michen00 merged commit 364f20e into main Oct 28, 2026
18 checks passed
@michen00
michen00 deleted the ci/pin-writer-actions branch October 28, 2026 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants