Read this in other languages: English, 日本語.
GitHub Actions to get next version from commit histories.
e.g. Add release tag
on:
pull_request:
branches:
- main
types: [closed]
name: Add release tag
jobs:
tag:
name: Add release tag
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && github.event.pull_request.head.ref == 'release/next'
steps:
- name: Get next version
uses: technote-space/get-next-version-action@v1
- uses: actions/github-script@0.4.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${process.env.NEXT_VERSION}`,
sha: context.sha
})
name | description | default | required | e.g. |
---|---|---|---|---|
MINOR_UPDATE_TYPES | Minor update commit types | feat |
feat, refactor |
|
EXCLUDE_MESSAGES | Exclude messages | tweaks |
||
BREAKING_CHANGE_NOTES | Breaking change notes | BREAKING CHANGE |
BREAKING |
|
SET_ENV_NAME | Env name | NEXT_VERSION |
NEW_TAG |
|
GITHUB_TOKEN | Access token | ${{github.token}} |
true | ${{secrets.ACCESS_TOKEN}} |
name | description | e.g. |
---|---|---|
current | current version | v1.2.3 |
next | next version | v1.3.0 |
eventName | action |
---|---|
pull_request, pull_request_target | opened, reopened, synchronize, closed |