[pre-commit.ci] pre-commit autoupdate #265
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: Pull requests | |
on: # yamllint disable-line rule:truthy | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] | |
jobs: | |
update-changelog: | |
runs-on: ubuntu-latest | |
name: "Pre-commit CI CHANGELOG auto-update" | |
if: > | |
(github.event.pull_request.title == '[pre-commit.ci] pre-commit autoupdate') && | |
(github.event.action == 'opened') | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: 0 | |
token: ${{ secrets.PRE_COMMIT_CI_CHANGELOG }} | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
cache: 'pip' | |
cache-dependency-path: '**/setup.cfg' | |
- name: Install dependencies | |
run: | | |
python3 -m pip install 'git+https://github.com/Takishima/[email protected]' | |
- name: Run Python script | |
run: | | |
python3 -m update_changelog --pr-body "${{ github.event.pull_request.body }}" | |
- name: Commit changes | |
id: commit | |
uses: EndBug/add-and-commit@v9 | |
with: | |
author_name: github-actions[bot] | |
author_email: [email protected] | |
message: Update CHANGELOG | |
changelog: | |
needs: update-changelog | |
runs-on: ubuntu-latest | |
name: CHANGELOG enforcer | |
if: '!cancelled()' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: 0 | |
- uses: dangoslen/changelog-enforcer@v3 | |
with: | |
changeLogPath: 'CHANGELOG.md' | |
skipLabels: 'Skip-Changelog' |