ci: sign docs-sync commits with a GitHub App token#10
Merged
Conversation
The target repo requires signed commits on PRs. create-pull-request's sign-commits builds commits via the GitHub API, which only signs them (as the app bot, Verified) when authenticated with a bot token — the fine-grained PAT left them unsigned. gitsign was a dead end too, since Sigstore signatures always show Unverified on GitHub. Mint an installation token via actions/create-github-app-token (scoped with owner/repositories to the cross-org target), drop the gitsign step and id-token permission, and keep sign-commits: true. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Why
The
export-docs.ymlworkflow opens a docs-sync PR againstCoverageTracker/coverage-tracker, which requires signed commits on PRs. Four prior iterations failed for two root causes:sign-commits: true(ci: switch to fine-grained personal access token #9) —peter-evans/create-pull-requestbuilds commits via the GitHub API, which only signs them (as the app bot, Verified) when authenticated with a bot token. A PAT creates the PR but leaves commits unsigned. (ci: switch to GITHUB_TOKEN signing #7'sGITHUB_TOKENalso can't write cross-repo.)What
Authenticate with a GitHub App installation token so
sign-commits: trueyields GitHub-Verified commits:actions/create-github-app-token@v2step, scoped withowner: CoverageTracker+repositories: coverage-tracker(mandatory for the cross-repo target).coverage-trackercheckout and thecreate-pull-requeststep.Setup Gitsignstep and the now-unusedid-token: writepermission.sign-commits: true.README.mdprovisioning section: PAT → dedicated GitHub App (DOCS_SYNC_APP_ID/DOCS_SYNC_APP_PRIVATE_KEY).Required manual setup before this works
Create a GitHub App on the CoverageTracker org (Contents RW + Pull requests RW), install it on
coverage-tracker, and add secretsDOCS_SYNC_APP_ID+DOCS_SYNC_APP_PRIVATE_KEYto this repo.Verify
Trigger the workflow, then confirm the
docs-syncPR commits carry the green Verified badge and are authored by the app bot — a green run with unverified commits is the current failure mode.🤖 Generated with Claude Code