diff --git a/.github/workflows/git-tag.yml b/.github/workflows/git-tag.yml new file mode 100644 index 0000000..e429cf1 --- /dev/null +++ b/.github/workflows/git-tag.yml @@ -0,0 +1,25 @@ +name: "git tag v2" +on: + release: + types: + - published + +jobs: + v2: + runs-on: ubuntu-latest + steps: + - name: check out repository code + uses: actions/checkout@v3 + - name: git config + run: | + git config --global user.name "${GITHUB_ACTOR}" + git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" + - name: git tag + run: | + git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} + git tag -d v2 + git push origin -d v2 + git tag v2 ${GITHUB_SHA} + git push origin v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}