ci(rebase-stack): use STACK_REBASE_TOKEN so rebased pushes trigger CI#166
Merged
Conversation
## Summary
`.github/workflows/rebase-stack.yml` was authenticating with the default `GITHUB_TOKEN` for both `actions/checkout` (which configures git credentials for the push) and the `gh` CLI. Pushes made with `GITHUB_TOKEN` are intentionally ignored by GitHub's workflow trigger (anti-recursion protection), so the force-pushed rebased branch never fired `pull_request.synchronize` and CI did not run on the rebased PR.
The repo already has a `STACK_REBASE_TOKEN` secret holding a personal access token but it was not referenced anywhere.
### Changes
- `actions/checkout@v4` now passes `token: ${{ secrets.STACK_REBASE_TOKEN }}` so `git push --force-with-lease` is attributed to a user.
- `GH_TOKEN` is set to the same secret so `gh pr edit` / `gh pr comment` are also user-attributed.
- Removed the `gh api .../check-suites` POST workaround. It was a band-aid for the `GITHUB_TOKEN` limitation and would now create a duplicate empty check suite alongside the real `pull_request.synchronize` run.
## Test Plan
- ✅ `make fmt` and `make lint` clean.
- Workflow change is exercised on PR merge; will be validated when the next stacked PR is merged and CI fires on the rebased child PR.
## Issues
ab9e648 to
e345a70
Compare
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
.github/workflows/rebase-stack.ymlwas authenticating with the defaultGITHUB_TOKENfor bothactions/checkout(which configures git credentials for the push) and theghCLI. Pushes made withGITHUB_TOKENare intentionally ignored by GitHub's workflow trigger (anti-recursion protection), so the force-pushed rebased branch never firedpull_request.synchronizeand CI did not run on the rebased PR.The repo already has a
STACK_REBASE_TOKENsecret holding a personal access token but it was not referenced anywhere.Changes
actions/checkout@v4now passestoken: ${{ secrets.STACK_REBASE_TOKEN }}sogit push --force-with-leaseis attributed to a user.GH_TOKENis set to the same secret sogh pr edit/gh pr commentare also user-attributed.gh api .../check-suitesPOST workaround. It was a band-aid for theGITHUB_TOKENlimitation and would now create a duplicate empty check suite alongside the realpull_request.synchronizerun.Test Plan
make fmtandmake lintclean.Issues