fix(ci): use deploy key for release automation git pushes#160
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b42037911
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| fetch-depth: 0 | ||
| ref: ${{ steps.target.outputs.branch }} | ||
| ssh-key: ${{ secrets.RELEASE_DEPLOY_KEY }} | ||
| persist-credentials: false |
There was a problem hiding this comment.
Keep checkout credentials persisted for semantic-release
This workflow now disables credential persistence even though later steps rely on authenticated Git pushes (npm run release:run with @semantic-release/git), so the deploy key is not available to subsequent git push/tag operations and release publishing will still fail with SSH auth errors. actions/checkout's persist-credentials: false opts out of configuring token/SSH auth for later git commands, which conflicts with the intended deploy-key push path in this job.
Useful? React with 👍 / 👎.
| ref: next | ||
| fetch-depth: 0 | ||
| ssh-key: ${{ secrets.RELEASE_DEPLOY_KEY }} | ||
| persist-credentials: false |
There was a problem hiding this comment.
Preserve auth credentials for sync workflow pushes
The sync job also disables credential persistence but then performs git push origin HEAD:next; with persist-credentials: false, checkout does not leave the deploy-key auth configured for subsequent git commands, so this push step can fail with Permission denied (publickey) and break automatic main -> next synchronization after releases.
Useful? React with 👍 / 👎.
What does this PR do?
Fixes post-merge release automation failures caused by git auth mismatch in protected-branch workflows.
release-check,sync-main-release-back-to-next)@semantic-release/gitpush/tag uses deploy key authThis keeps workflow behavior same, only auth transport changes.
Type of change
Checklist
npm run check:cipasses (lint + format)npx tsc --noEmitpasses (type check)npm testpasses (unit tests)Testing
Validated by configuration-level checks and dry-run release initialization:
Also verified failing production run root cause and fix target:
@semantic-release/gitpush rejected by branch rules using HTTPS/token path.Notes for reviewers
next.