File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4343 ref : ${{ github.event.workflow_run.head_branch || github.ref }}
4444 token : ${{ steps.vault.outputs.GITHUB_TOKEN }}
4545
46+ - name : Create local main branch reference
47+ # semantic-release needs a local 'main' branch to run 'git tag --merged main'
48+ # When checking out a non-main branch (e.g., canary), we need to create this reference
49+ run : |
50+ if [ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]; then
51+ git branch -f main origin/main
52+ fi
53+
4654 - name : Get Automation Bot User ID
4755 id : get-user-id
4856 run : |
@@ -95,6 +103,10 @@ jobs:
95103 GIT_AUTHOR_EMAIL : ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
96104 GIT_COMMITTER_NAME : ${{ steps.vault.outputs.GIT_COMMITTER_NAME }}
97105 GIT_COMMITTER_EMAIL : ${{ steps.vault.outputs.GIT_COMMITTER_EMAIL }}
106+ # Fix: Override GITHUB_REF for workflow_run trigger
107+ # In workflow_run, GITHUB_REF points to the default branch (main), not the branch that triggered CI
108+ # This tells semantic-release which branch configuration to use (main vs canary prerelease)
109+ GITHUB_REF : refs/heads/${{ github.event.workflow_run.head_branch || github.ref_name }}
98110
99111 - name : Get latest release tag
100112 id : get-tag
You can’t perform that action at this time.
0 commit comments