Skip to content

Commit 8145b8f

Browse files
committed
create release tag with gh api instead of push
1 parent 388997d commit 8145b8f

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
steps:
2222
- name: Checkout
2323
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24+
with:
25+
persist-credentials: false
2426

2527
- name: Setup Node
2628
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
@@ -57,13 +59,16 @@ jobs:
5759
5860
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
5961
60-
- name: Create and push tag
62+
- name: Create tag
6163
if: inputs.tag != '' && !startsWith(github.ref, 'refs/tags/')
6264
env:
65+
GH_TOKEN: ${{ github.token }}
66+
GH_REPO: ${{ github.repository }}
6367
RELEASE_TAG: ${{ steps.release-tag.outputs.tag }}
6468
run: |
65-
git tag "$RELEASE_TAG"
66-
git push origin "$RELEASE_TAG"
69+
gh api "repos/$GH_REPO/git/refs" \
70+
-f ref="refs/tags/$RELEASE_TAG" \
71+
-f sha="$GITHUB_SHA"
6772
6873
- name: Build
6974
run: npm run build

0 commit comments

Comments
 (0)