File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -192,12 +192,21 @@ jobs:
192192 echo "$ASSETS" >> $GITHUB_ENV
193193 echo "EOF" >> $GITHUB_ENV
194194
195- - name : Create and push tag
195+ - name : Create tag via API
196+ env :
197+ GH_TOKEN : ${{ secrets.PAT_TOKEN }}
196198 run : |
197- git config user.name "GitHub Action"
198- git config user.email "action@github.com"
199- git tag -a "v${{ env.VERSION }}" -m "Release v${{ env.VERSION }}"
200- git push origin "v${{ env.VERSION }}"
199+ # Get the current commit SHA
200+ COMMIT_SHA=$(git rev-parse HEAD)
201+
202+ # Create tag via GitHub API (bypasses push restrictions)
203+ gh api \
204+ --method POST \
205+ -H "Accept: application/vnd.github+json" \
206+ -H "X-GitHub-Api-Version: 2022-11-28" \
207+ /repos/${{ github.repository }}/git/refs \
208+ -f "ref=refs/tags/v${{ env.VERSION }}" \
209+ -f "sha=${COMMIT_SHA}" || echo "Tag may already exist"
201210
202211 - name : Create GitHub Release and Upload Assets
203212 uses : softprops/action-gh-release@v2
You can’t perform that action at this time.
0 commit comments