Skip to content

ci: sign commits in bump_version workflow [SEC-2166]#116

Merged
leifdreizler merged 4 commits into
developfrom
sign-bump-version
May 11, 2026
Merged

ci: sign commits in bump_version workflow [SEC-2166]#116
leifdreizler merged 4 commits into
developfrom
sign-bump-version

Conversation

@leifdreizler
Copy link
Copy Markdown
Contributor

@leifdreizler leifdreizler commented May 8, 2026

Summary

Makes the bump_version workflow produce signed commits

  • Sign the bump commit. Replace local git commit -am (unsigned, the cause of the "Require Signed Commits" Fails in Rule Insights) with peter-evans/create-pull-request@v8.1.1
  • Collapse PR creation. peter-evans handles opening the PR, so the manual gh pr create step and the unreachable gh pr list | grep "PR exists" guard are gone.
  • Tag via API. Switch tag creation to gh api .../git/refs against pull-request-head-sha from peter-evans, since local HEAD doesn't advance after an API commit. Result is the same lightweight tag as before.
  • Modernize token minting. Replace the bespoke JWT + curl block with actions/create-github-app-token@v3.1.1
  • Drop unused permissions. permissions: {} since the workflow no longer touches secrets.GITHUB_TOKEN.

Testing

This run successfully opened this PR. Tagging correctly skipped for existing version on this run.

🤖 Generated with Claude Code

leifdreizler and others added 2 commits May 8, 2026 13:10
Switches token minting to actions/create-github-app-token@v3.1.1 (pinned
by SHA), uses SEMGREP_CI_CLIENT_ID, scopes the token to this repo via
`repositories:`, and drops the now-unused permissions block since the
workflow no longer relies on secrets.GITHUB_TOKEN.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces local `git commit -am` (unsigned) with peter-evans/create-pull-request
using `sign-commits: true`, which creates the commit through the GitHub
Contents API so the App installation token signs it. Also collapses the
manual `gh pr create` step (peter-evans handles PR creation) and switches
the tag to `gh api .../git/refs`, pointing at the new commit SHA returned
by peter-evans rather than the now-stale local HEAD.

Pins actions/checkout to v6.0.2 by SHA and drops its write token in favor
of `persist-credentials: false` since nothing pushes via local git anymore.
Normalizes input access on `inputs.*`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread .github/workflows/bump_version.yml
app-id is deprecated in v3.1.1 with a "Use 'client-id' instead"
deprecation message. The secret is already SEMGREP_CI_CLIENT_ID,
so swap the input name to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@leifdreizler leifdreizler marked this pull request as ready for review May 8, 2026 20:54
When the dispatched version is already on develop, bump-version.sh is
a no-op and peter-evans sets pull-request-operation=none with
pull-request-head-sha pointing at develop's existing HEAD. The tag
step then tried to create refs/tags/vX.Y.Z at that already-tagged
commit and failed with 422 "Reference already exists". Gate the tag
step on a PR actually being created/updated so no-op dispatches
exit cleanly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread .github/workflows/bump_version.yml
Comment thread .github/workflows/bump_version.yml
@leifdreizler leifdreizler changed the title ci: sign commits in bump_version workflow ci: sign commits in bump_version workflow [SEC-2166] May 8, 2026
@leifdreizler leifdreizler merged commit fc8484b into develop May 11, 2026
6 checks passed
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