Skip to content

Commit

Permalink
chore: add auto tag git workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
huynguyen-hl committed Jun 28, 2024
1 parent 2e8dcc0 commit 5bba0b3
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/tag-main-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Tag Main Branch

on:
push:
branches:
- test-tag-branch
workflow_dispatch:

permissions:
contents: write

jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Git
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
- name: Determine tag version
id: get_tag
run: |
echo "TAG_NAME=v1.0.$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV
- name: Create and push tag
env:
TAG_NAME: ${{ env.TAG_NAME }}
run: |
git tag $TAG_NAME
git push origin $TAG_NAME

0 comments on commit 5bba0b3

Please sign in to comment.