File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 11name : Release
22
33on :
4+ workflow_dispatch :
45 push :
56 tags :
67 - ' v*.*.*'
Original file line number Diff line number Diff line change @@ -18,15 +18,15 @@ jobs:
1818 fetch-depth : 0 # fetch all tags
1919
2020 - name : Tag and push if new version
21+ env :
22+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2123 run : |
2224 VERSION=$(jq -r .version package.json)
2325 TAG="v$VERSION"
2426 if git rev-parse "$TAG" >/dev/null 2>&1; then
2527 echo "Tag $TAG already exists. No action taken."
2628 else
27- git config user.name "github-actions[bot]"
28- git config user.email "github-actions[bot]@users.noreply.github.com"
29- git tag "$TAG"
30- git push origin "$TAG"
31- echo "Tag $TAG created and pushed."
29+ gh auth login --with-token < <(echo "$GH_TOKEN")
30+ gh api repos/${GITHUB_REPOSITORY}/git/refs -f ref="refs/tags/$TAG" -f sha="$(git rev-parse HEAD)"
31+ echo "Tag $TAG created via GitHub API."
3232 fi
You can’t perform that action at this time.
0 commit comments