From dafc220ef467a61b78e8a408554b29723c133dfd Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Fri, 17 Nov 2023 13:37:34 -0500 Subject: [PATCH] Update changlog CI to use a pre-built workflow. --- .github/workflows/changelog.yml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index ebedec183..66b7e7c11 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -1,16 +1,25 @@ -name: Ensure changelog +name: Changelog on: pull_request: types: [labeled, unlabeled, opened, synchronize, reopened] +# Only cancel in-progress jobs or runs for the current workflow +# This cancels the already triggered workflows for a specific PR without canceling +# other instances of this workflow (other PRs, scheduled triggers, etc) when something +# within that PR re-triggers this CI +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: - ensure_changelog: - name: Verify that a changelog entry exists for this pull request + changelog: + name: Confirm changelog entry runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - submodules: true - - run: grep -P '\[[^\]]*#${{github.event.number}}[,\]]' CHANGES.rst - if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog-entry-needed') }} + - name: Check change log entry + uses: scientific-python/action-check-changelogfile@6087eddce1d684b0132be651a4dad97699513113 # 0.2 + env: + CHANGELOG_FILENAME: CHANGES.rst + CHECK_MILESTONE: false + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}