Skip to content

fix(ci): sync README on release branch after release-plz release-pr#277

Closed
zeitlinger wants to merge 5 commits into
mainfrom
fix/release-pr-docs-sync
Closed

fix(ci): sync README on release branch after release-plz release-pr#277
zeitlinger wants to merge 5 commits into
mainfrom
fix/release-pr-docs-sync

Conversation

@zeitlinger

Copy link
Copy Markdown
Member

Summary

After release-plz release-pr pushes the release branch with the bumped Cargo.toml + CHANGELOG, check it out and run release:docs-sync there, then push any README/Cargo.lock updates as an additional commit.

Why

Without this the README pin stays at the previous version and the readme_quickstart_tools_snippets_stay_current test fails on the release PR — that's what blocked #242 after the v0.22.0 bump.

This was the second commit of #276 that didn't make it through the squash merge.

Caveats

  • Each release-plz run force-pushes the release branch and wipes the docs-sync commit. Docs-sync re-runs in the same workflow run and re-creates it, so the PR stays consistent — but CI may briefly see two pushes.
  • Uses https://x-access-token:$TOKEN@github.com/... for the push because actions/checkout runs with persist-credentials: false.

Test plan

  • CI green on this PR
  • On next push to main, release PR refreshes with both bumped Cargo.toml/CHANGELOG and synced README in the same workflow run

After release-plz release-pr pushes the release branch with the bumped
Cargo.toml + CHANGELOG, check it out and run release:docs-sync there,
then push any README/Cargo.lock updates as an additional commit. Without
this the README pin stays at the previous version and the
readme_quickstart_tools_snippets_stay_current test fails on the release
PR (as seen on #242 after the v0.22.0 bump).

This was the second commit of #276 that didn't make it through the squash
merge.
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger marked this pull request as ready for review May 8, 2026 15:35
@zeitlinger zeitlinger requested a review from a team as a code owner May 8, 2026 15:35
Copilot AI review requested due to automatic review settings May 8, 2026 15:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the release PR automation so that after release-plz release-pr updates the release-plz-* branch, the workflow checks out that branch, runs a docs sync task, and pushes any resulting README/lockfile updates as an additional commit—keeping the release PR consistent with the bumped crate version.

Changes:

  • Update .mise release PR task to run release-plz release-pr and then locate the latest release-plz-* branch.
  • Check out the release branch, run release:docs-sync, and push a follow-up commit when docs changed.
  • Push uses an explicit token-authenticated GitHub HTTPS URL to work with actions/checkout using persist-credentials: false.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .mise/tasks/release/pr Outdated
Comment thread .mise/tasks/release/pr Outdated
zeitlinger added 3 commits May 8, 2026 15:44
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Address Copilot feedback on #277:

- Call `sync-readme-snippets` directly instead of `release:docs-sync`,
  which also runs `flint --fix` against all linters and could pick up
  unrelated drift onto the release branch.
- Fail explicitly when `GITHUB_REPOSITORY` is unset instead of falling
  back to `grafana/flint`. The task is CI-only; outside CI the fallback
  could push to upstream unexpectedly.
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
martincostello
martincostello previously approved these changes May 8, 2026
Comment thread .mise/tasks/release/pr Outdated
Per Martin's review feedback on #277: instead of hardcoding
github-actions[bot] as the commit author, query the GitHub API for
the token's actual user so the commit identity matches the GitHub
identity that owns the push. Works for both the default GITHUB_TOKEN
(github-actions[bot]) and a PAT (a real user).
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger enabled auto-merge (squash) May 9, 2026 07:48
@zeitlinger zeitlinger disabled auto-merge May 9, 2026 07:53
@zeitlinger

Copy link
Copy Markdown
Member Author

obsolete with #280

@zeitlinger zeitlinger closed this May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants