ci: move dist/ auto-commit to PR branch instead of main#21
Merged
Conversation
The post-merge auto-commit in main.yml violated branch protection rules (PR required + Test status check required), causing CI to fail after Dependabot merges. dist/ is now built and committed to the PR branch during the pull-request workflow. Squash-merging includes the updated dist/, so main.yml no longer needs to push dist/ directly to main. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
actions/checkout defaults to a detached HEAD at the merge commit on pull_request events, making it impossible to push back to the PR branch without --force. Using ref: github.head_ref checks out the actual PR branch so the push succeeds with a normal fast-forward. Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
git pushstep frommain.ymlthat was pushingdist/directly tomain— this violated branch protection rules (PR required + Test status check required), causing CI to fail after every Dependabot mergepull-request.ymlthat commits and pushesdist/to the PR branch insteadpermissions: contents: writeto the PR workflow job so it can push to the PR branchHow it works after this change
pnpm buildchangesdist/, the workflow auto-commits it to the PR branchdist/is included in the squash commitmain.ymlruns after merge, buildsdist/again, finds no changes — nothing to pushTest plan
main.ymlcompletes without the GH013 push errorpull-request.ymlauto-commitsdist/to the PR branch if it changedGenerated with Claude Code