Fix: Authenticate release workflow via SSH deploy key - #6
Merged
Conversation
…e PAT The release-workflow checkout used a personal access token (secrets.PAT) that had gone stale, causing 'terminal prompts disabled' failures on fetch. Switch to a repo-scoped SSH deploy key (secrets.COMMIT_KEY) with write access, loaded via webfactory/ssh-agent so axion-release can push the release tag/commit over SSH. Also drops the DEPLOY_KEY env var, which nothing in axion-release-plugin actually reads.
There was a problem hiding this comment.
Pull request overview
This PR fixes the “Create Release” GitHub Actions workflow authentication by replacing a stale Personal Access Token (PAT) with an SSH deploy key, so the workflow can fetch/push over SSH and still trigger downstream workflows (e.g., Publish) via tag pushes.
Changes:
- Updated
actions/checkoutin the release workflow to authenticate usingsecrets.COMMIT_KEYviassh-key. - Added
webfactory/ssh-agent@v0.10.0to load the same deploy key for subsequent git operations during the release step. - Removed the unused
DEPLOY_KEYenvironment variable from the Gradle release steps and documented the fix in the changelog.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| CHANGELOG.md | Notes the workflow authentication fix (SSH deploy key replacing stale PAT). |
| .github/workflows/release-workflow.yml | Switches checkout/auth to COMMIT_KEY via SSH and removes dead env config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
v4 was several majors behind current (v7.0.1). Verified our fetch-depth and ssh-key usage is unaffected by the intervening breaking changes (Node 24 runtime bump in v5/v6, fork-PR checkout restriction in v7 that only applies to pull_request_target/workflow_run triggers, neither of which this workflow uses).
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
Create Releaseworkflow'sactions/checkoutstep usedsecrets.PAT, a personal access token last updated in 2023 that had gone stale — causingfatal: could not read Username for 'https://github.com': terminal prompts disabledon fetch.GITHUB_TOKEN) is required here because pushes made with the default token don't trigger downstream workflows (needed so the new tag kicks offPublish).actions/checkoutnow usesssh-key: secrets.COMMIT_KEY, andwebfactory/ssh-agent@v0.10.0loads the same key into an agent so axion-release can push the release tag/commit over SSH.COMMIT_KEYsecret.DEPLOY_KEYenv var — nothing in axion-release-plugin actually reads it, so it was dead config.Test plan
gh api repos/dotRun/MCVotifierLib/keys), confirmed via API response (read_only: false)COMMIT_KEYsecret set and confirmed present (gh secret list)Next: re-run the
Create Releaseworkflow after merging to confirm the fix end-to-end.