Skip to content

[pre-commit.ci] pre-commit autoupdate #707

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #707

Workflow file for this run

---
name: Format
on: # yamllint disable-line rule:truthy
pull_request:
push:
branches:
- main
- "v*"
jobs:
parse-changelog:
name: Parse CHANGELOG
runs-on: ubuntu-latest
if: >-
github.event_name == 'pull_request'
&& (startsWith(github.event.pull_request.head.ref, 'release/')
|| startsWith(github.event.pull_request.head.ref, 'hotfix/'))
steps:
- uses: actions/checkout@v4
- name: Installing parse-changelog
env:
target: x86_64-unknown-linux-musl
parse_changelog_tag: v0.5.4
source_url: https://github.com/taiki-e/parse-changelog/releases/download
run: |
curl -LsSf "${source_url}/${parse_changelog_tag}/parse-changelog-${target}.tar.gz" | tar xzf -
- name: Extract version from branch name (for release branches)
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'release/')
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#release/v}
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
git tag v${RELEASE_VERSION}
- name: Extract version from branch name (for hotfix branches)
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'hotfix/')
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#hotfix/v}
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
git tag v${RELEASE_VERSION}
- name: Calling parse-changelog
run: ./parse-changelog CHANGELOG.md "${RELEASE_VERSION}"