Repository navigation
ci(release): regenerate nix/Cargo.nix on release-plz's PR #8684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,3 +88,31 @@ jobs: | |
| env: | ||
| GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | ||
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
|
|
||
| # release-plz bumps Cargo.lock and the manifests without regenerating | ||
| # nix/Cargo.nix, which Check then fails as stale, so commit it on top. | ||
| # The app token's push, unlike GITHUB_TOKEN's, triggers Check. Authoring | ||
| # as moq-bot, as release-plz does, keeps its next run force-pushing this | ||
| # PR instead of closing it to preserve a contributor's commit. | ||
| - name: Regenerate the release PR's nix/Cargo.nix | ||
| env: | ||
| GH_TOKEN: ${{ steps.generate-token.outputs.token }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refresh authentication for the regeneration phase. The pinned token action issues installation tokens that expire after one hour. (raw.githubusercontent.com) If Release finishes shortly before expiry and regeneration crosses that deadline, the push fails and leaves the release PR's generated files stale. Create a fresh token for this phase. Supply the fresh token to both
|
||
| GIT_AUTHOR_NAME: moq-bot[bot] | ||
| GIT_AUTHOR_EMAIL: 186640430+moq-bot[bot]@users.noreply.github.com | ||
| GIT_COMMITTER_NAME: moq-bot[bot] | ||
| GIT_COMMITTER_EMAIL: 186640430+moq-bot[bot]@users.noreply.github.com | ||
| run: | | ||
| branch=$(gh pr list --base release --state open --json headRefName --jq '.[].headRefName | select(startswith("release-plz-"))') | ||
| if [ -z "$branch" ]; then | ||
| echo "No open release PR." | ||
| exit 0 | ||
| fi | ||
| git fetch --no-tags origin "refs/heads/$branch" | ||
| git checkout --detach FETCH_HEAD | ||
| nix develop --command just rs cargo-nix | ||
|
Comment on lines
+111
to
+112
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not execute PR-branch code while the app token is in scope. The step at lines 97-112 checks out the head of an open The The checkout at lines 64-69 also does not set Keep executable inputs on the trusted
|
||
| if git diff --quiet -- nix; then | ||
| echo "nix/Cargo.nix is current." | ||
| exit 0 | ||
| fi | ||
| git commit --message "chore: regenerate nix/Cargo.nix" -- nix | ||
| git push origin "HEAD:refs/heads/$branch" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name the maintainer handoff for
nix/Cargo.nixin the land-fixer comment.The comment says the land fixer regenerates
nix/Cargo.nixand re-enqueues the PR. This repository's watcher treatsnix/as a protected path. A fix that changesnix/Cargo.nixis handed back forquest land applyunless the base merge already carries that change. Describe that handoff so maintainers expect it.Suggested comment update
Committable suggestion