概要
- ある変更の塊に対してタグを付けたい
- ローカルでやると間違えるのでCIで統一したい
- tagとreleaseを分けたい
コード
.github/workflows/tagging.yml
name: tagging
on:
workflow_dispatch:
inputs:
version:
type: choice
description: "patch | minor | major"
required: true
default: "patch"
options:
- patch
- minor
- major
branches: [main]
jobs:
tagging:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: |
git config --local user.name "GitHub Actions"
git config --local user.email "actions@github.com"
NEXT_VERSION=$(npm version ${{ github.event.inputs.version }})
git add package.json package-lock.json
git push origin ${NEXT_VERSION}
動いている様子
まとめ