Merge pull request #16 from Rasic2/dev/zhouh #114
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: AddTag | |
| on: push | |
| jobs: | |
| add_tag: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.actor != 'dependabot[bot]' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: List Tags | |
| run: | | |
| date_now=$(date +"%Y.%m.%d") | |
| new_tag=$(echo -e "v${date_now}") | |
| git fetch origin --tags # obtain the tags from remote | |
| exist=$(git tag | grep ${new_tag} | wc -l) | |
| if [ ${exist} -eq 1 ];then | |
| git tag -d ${new_tag} # delete tag local | |
| git push origin :refs/tags/${new_tag} # delete tag remote | |
| fi | |
| git tag ${new_tag} | |
| git push origin --tags |