fix(ci): give release-plz git credentials for its temp-clone pushes #387
No reviewers
Labels
No labels
adr
automated
bug
chore
dependencies
documentation
enhancement
epic
github-actions
P1-high
P2-medium
P3-low
release
research
rust
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Slipstream/eventcore!387
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/release-plz-git-auth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Follow-up to #386. The release-plz run on main got much further on the
ubuntu-24.04runner but failed at the push step:release-plz copies the repo to a temp directory and pushes release branches/tags from there over HTTPS.
actions/checkout@v6stores its credentials behind gitdir-scopedincludeIfconfig, which the temp copy does not inherit — so release-plz's pushes have no credentials.Fix
Port the
configure-release-plz-git-auth.shaskpass helper used by the emc repo and source it in the same step that invokes release-plz, in bothrelease-plz.yml(usesRELEASE_PLZ_TOKEN) andpublish.yml(uses the actions token).Notes
The changes appear safe to merge, but ensure the script is executable in the CI environment.
Walkthrough
.forgejo/scripts/configure-release-plz-git-auth.sh
GIT_ASKPASSto provide credentials during git operations.GIT_TOKENis set before proceeding..forgejo/workflows/publish.yml and release-plz.yml
GIT_TOKENenvironment variable to the appropriate token for authentication.LLM usage and cost
Estimated total USD: $0.015205 via https://api.openai.com and https://api.openai.com
🟡 Warning: Ensure that the
configure-release-plz-git-auth.shscript is executable in the CI environment. If not, the script may fail to run, causing the workflow to break.@ -53,7 +53,12 @@ jobs:env:CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}Should this not also be the RELEASE_PLZ_TOKEN?
New commits pushed, approval review dismissed automatically according to repository settings
The PR updates the CI workflow to use
RELEASE_PLZ_TOKENfor git operations, addressing credential issues during release-plz runs. Ensure the token has appropriate permissions.Walkthrough
Δ since
ea43d71:.forgejo/workflows/publish.ymlto replaceGITHUB_TOKENwithRELEASE_PLZ_TOKENfor git operations.LLM usage and cost
Estimated total USD: $0.009795 via https://api.openai.com and https://api.openai.com
🟡 Warning: Ensure that the
RELEASE_PLZ_TOKENhas the necessary permissions for all operations previously covered byGITHUB_TOKEN, especially if there are differences in scope or permissions between these tokens.Addressed review feedback in
bb242e0.The script is sourced with
.rather than executed, so the executable bit is not required at runtime — but it is committed with mode 100755 anyway (git ls-files -sshows 100755), so direct execution would also work.@ -54,2 +54,3 @@CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}GIT_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}Agreed — switched the checkout token, GITHUB_TOKEN, and GIT_TOKEN in this workflow to RELEASE_PLZ_TOKEN in
bb242e0, matching the release-pr workflow and emc's release phase. The PAT pushes tags under the bot identity and would trigger any future tag-driven workflows, which the ephemeral actions token deliberately does not.@auto-review re-review
Queued a forced review at
bb242e04ee. This intentionally bypasses CI gating; watch the commit-status badge for progress.The changes appear safe to merge, with no library code modifications.
Walkthrough
.forgejo/scripts/configure-release-plz-git-auth.sh:
GIT_ASKPASSto provide credentials, ensuring git operations can proceed without manual input..forgejo/workflows/publish.yml and release-plz.yml:
RELEASE_PLZ_TOKENfor authentication, aligning with the new script.LLM usage and cost
Estimated total USD: $0.016736 via https://api.openai.com and https://api.openai.com
@ -0,0 +38,4 @@chmod 700 "$askpass_path"export GIT_ASKPASS="$askpass_path"export GIT_TERMINAL_PROMPT=0🟡 Warning: Ensure that the
configure-release-plz-git-auth.shscript is sourced correctly in all workflows that require it, as missing this step will cause authentication failures during git operations.