Skip to content

Commit f3a828e

Browse files
parkerbxyzCopilot
andauthored
ci: create signed dist commits in release workflow (#404)
The `main` ruleset requires verified signatures, but the "chore: update dist files" commit on release-please PRs isn't signed. `git-auto-commit-action` creates it with plain `git push`. [Unsigned commits on the head branch can block squash merges too](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets#require-signed-commits), so the dist commit itself needs a signature. This replaces `git-auto-commit-action` with [`dsanders11/github-app-commit-action`](https://github.com/dsanders11/github-app-commit-action), pinned to the v2.1.0 commit SHA. It creates the commit through the REST Git Data API with the releaser app token, and GitHub signs commits that a GitHub App creates that way. - A new `git add dist` step stages the rebuilt files. The action commits only staged changes, so this replaces `file_pattern: dist/**`. - `commit_author` is removed. GitHub signs API commits only when they don't set a custom author, so the commit is now authored by the releaser app instead of `github.actor`. - `fail-on-no-changes: false` keeps the old behavior of skipping the commit when dist didn't change. The action uploads files as blobs, so the roughly 900 KB bundles aren't a problem. The releaser app token is still needed: if the commit used `GITHUB_TOKEN`, `test` wouldn't run on release PRs. The first release run after merging will confirm the commit shows as verified. Co-authored-by: Copilot App <[email protected]> Copilot-Session: c91009d9-b4f7-4eec-b30f-4b24ae578aa1
1 parent 655017f commit f3a828e

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,15 @@ jobs:
5151
- run: npm run build
5252
if: steps.release-please.outputs.prs_created == 'true'
5353

54-
- uses: stefanzweifel/git-auto-commit-action@4a55954c782fc1ea30b9056cd3e7a2b40ca8887d # v7.2.0
54+
- run: git add dist
55+
if: steps.release-please.outputs.prs_created == 'true'
56+
57+
- uses: dsanders11/github-app-commit-action@2bbcd331016d8c950b05a24b56e7eb9cb50d545e # v2.1.0
5558
if: steps.release-please.outputs.prs_created == 'true'
5659
with:
57-
commit_author: "${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>"
58-
commit_message: "chore: update dist files"
59-
file_pattern: dist/**
60+
message: "chore: update dist files"
61+
token: ${{ steps.app-token.outputs.token }}
62+
fail-on-no-changes: false
6063

6164
- name: Update major version tag
6265
id: update-major-tag

0 commit comments

Comments
 (0)