Skip to content

Commit a7a5272

Browse files
committed
fix(ci): push the RC tag with the PAT, not GITHUB_TOKEN
GitHub answers a GITHUB_TOKEN tag push with 'remote: Internal Server Error' - a 500, not a 403 - which is a tag ruleset rejecting the Actions token. The branch push in the step above already uses OPENSCREEN_RELEASE_TOKEN and works; only the tag push was still going through the checkout's origin remote. This failed the job outright when cutting v1.8.0-rc.1, and because the two remaining steps run after it, both the build trigger and the #rc-testing Discord announce were skipped. The tag had to be pushed by hand and the build dispatched manually, with no announce at all. Push the tag through the same PAT remote so a dispatched pre-release completes end to end from a release branch.
1 parent f508a21 commit a7a5272

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/prerelease.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,23 +115,28 @@ jobs:
115115
116116
- name: Push RC tag on the release branch
117117
env:
118-
# Use GITHUB_TOKEN for the tag push: a tag is a ref, not a file change, so
119-
# the workflows:write permission isn't needed.
118+
# Push the tag with the PAT, NOT the checkout's GITHUB_TOKEN remote.
119+
# GitHub answers a GITHUB_TOKEN tag push with `remote: Internal Server
120+
# Error` (a 500, not a 403) — a tag ruleset rejecting the Actions token.
121+
# That failed the whole job cutting v1.8.0-rc.1, which also skipped the
122+
# build trigger and the Discord announce below.
120123
# Note: GITHUB_TOKEN tag pushes do NOT trigger build.yml in this org's setup,
121124
# so we explicitly trigger it via gh workflow run right after.
125+
TOKEN: ${{ secrets.OPENSCREEN_RELEASE_TOKEN }}
122126
RC_TAG: ${{ steps.version.outputs.rc_tag }}
123127
NEXT: ${{ steps.version.outputs.next }}
124128
run: |
125129
set -euo pipefail
126130
BRANCH="release/v${NEXT}"
131+
REMOTE="https://x-access-token:${TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
127132
git fetch origin "$BRANCH"
128133
git checkout "$BRANCH"
129134
git reset --hard "origin/${BRANCH}"
130135
# Delete remote tag first (idempotent on rerun) and any local tag.
131-
git push origin ":${RC_TAG}" 2>/dev/null || true
136+
git push "$REMOTE" ":${RC_TAG}" 2>/dev/null || true
132137
git tag -d "$RC_TAG" 2>/dev/null || true
133138
git tag "$RC_TAG"
134-
git push origin "$RC_TAG"
139+
git push "$REMOTE" "$RC_TAG"
135140
136141
- name: Trigger build workflow
137142
env:

0 commit comments

Comments
 (0)