GitHub Actionsでgit tagを自動生成
masterにmerge (=production deploy) のタイミングでgit tagを自動でつけたい
code:.github/workflows/create_git_tag.yml
name: Create Git Tag
on:
push:
branches:
- master
jobs:
create-git-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
echo "v1-$(TZ=Asia/Tokyo date +%Y%m%d-%H%M%S)" > TAG_NAME
git tag $(cat TAG_NAME)
git push origin $(cat TAG_NAME)