ci: update from template #19
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: Push [create tag] | |
"on": | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: false | |
jobs: | |
merge: | |
name: Push [create tag] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
if: "${{ ! startsWith(github.event.head_commit.message, 'docs: update changelog for ') }}" | |
uses: actions/checkout@v4.1.6 | |
with: | |
token: ${{ secrets.PAT }} | |
fetch-depth: 0 | |
- name: Get Next Version | |
if: "${{ ! startsWith(github.event.head_commit.message, 'docs: update changelog for ') }}" | |
id: semver | |
uses: ietf-tools/semver-action@v1.10.0 | |
with: | |
token: ${{ github.token }} | |
branch: main | |
noVersionBumpBehavior: silent | |
noNewCommitBehavior: silent | |
- name: Update CHANGELOG.md | |
if: "${{ ! startsWith(github.event.head_commit.message, 'docs: update changelog for ') && steps.semver.outputs.next != '' }}" | |
uses: orhun/git-cliff-action@v4 | |
with: | |
config: .cliff.git.toml | |
args: --tag ${{ steps.semver.outputs.next }} | |
env: | |
OUTPUT: CHANGELOG.md | |
- uses: EndBug/add-and-commit@v9.1.4 | |
if: "${{ ! startsWith(github.event.head_commit.message, 'docs: update changelog for ') && steps.semver.outputs.next != '' }}" | |
with: | |
add: 'CHANGELOG.md' | |
commit: --signoff | |
default_author: github_actor | |
fetch: true | |
message: 'docs: update changelog for ${{ steps.semver.outputs.next }}' | |
tag: '${{ steps.semver.outputs.next }} --force' | |
tag_push: '--force' |