fix: push tag to GitHub before creating release
Ensures the tag exists on the correct GitHub repo before attempting
to create a release. This prevents the release from being created on
the wrong repo when the tag doesn't exist yet.
The fix adds a git push of the tag to the target GitHub repo
(determined by ${GITHUB_REPO}) before calling the GitHub API to
create the release.
This commit is contained in:
@@ -122,6 +122,9 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
[ "$SKIP_BUILD" = "true" ] && exit 0
|
[ "$SKIP_BUILD" = "true" ] && exit 0
|
||||||
|
# Push tag to GitHub first so it exists before creating the release
|
||||||
|
git remote add github-release https://x-access-token:${{ secrets.GH_PAT }}@github.com/${GITHUB_REPO}.git 2>/dev/null || true
|
||||||
|
git push -f github-release ${GITHUB_REF_NAME} 2>/dev/null || true
|
||||||
GH_API="https://api.github.com/repos/${GITHUB_REPO}"
|
GH_API="https://api.github.com/repos/${GITHUB_REPO}"
|
||||||
# Create release or fetch existing one
|
# Create release or fetch existing one
|
||||||
BODY=$(curl -s -X POST \
|
BODY=$(curl -s -X POST \
|
||||||
|
|||||||
Reference in New Issue
Block a user