Skip to content
This repository was archived by the owner on May 4, 2026. It is now read-only.

Commit 5434edc

Browse files
authored
Modify tag creation to use GITHUB_TOKEN for push
Updated the git tag creation step to use GITHUB_TOKEN for pushing tags securely.
1 parent 10b7f08 commit 5434edc

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/release_build_push.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Checkout repository
1818
uses: actions/checkout@v4
1919
with:
20-
fetch-depth: 0 # Important for tagging
20+
fetch-depth: 0
2121
persist-credentials: false
2222

2323
- name: Generate tag name from current date
@@ -33,13 +33,15 @@ jobs:
3333
echo "exists=false" >> $GITHUB_OUTPUT
3434
fi
3535
36-
- name: Create git tag
36+
- name: Create git tag and push using token
3737
if: steps.check_tag.outputs.exists == 'false'
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3840
run: |
3941
git config user.name "github-actions[bot]"
4042
git config user.email "github-actions[bot]@users.noreply.github.com"
4143
git tag ${{ steps.date.outputs.tag }}
42-
git push origin ${{ steps.date.outputs.tag }}
44+
git push https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }} ${{ steps.date.outputs.tag }}
4345
4446
- name: Create GitHub Release
4547
if: steps.check_tag.outputs.exists == 'false'

0 commit comments

Comments
 (0)