From b8a877cc328af14c37286e48744be29213e5b4c8 Mon Sep 17 00:00:00 2001 From: Matthew Peveler Date: Sun, 31 Dec 2023 10:04:44 -0500 Subject: [PATCH] DEV: Move title check to own workflow (#2384) Move the title check script introduced in #2378 into its own workflow where it's triggered by `[opened, reopened, edited, synchronize]`, where the difference is in the addition of `edited` type. This allows the workflow to be triggered on editing any part of the PR, most importantly the title attribute to fix it not following conventions. Otherwise, it would require the user to either push a new commit or open/close the PR which is not as intuitive to fix. --- .github/workflows/github-ci.yaml | 6 ------ .github/workflows/title-check.yml | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/title-check.yml diff --git a/.github/workflows/github-ci.yaml b/.github/workflows/github-ci.yaml index 54f986cb2..7d0f1426c 100644 --- a/.github/workflows/github-ci.yaml +++ b/.github/workflows/github-ci.yaml @@ -164,12 +164,6 @@ jobs: - name: Test with mypy run : | mypy pypdf - - name: Check PR title - env: - PR_TITLE: ${{ github.event.pull_request.title }} - run: | - python .github/scripts/check_pr_title.py - if: github.event_name == 'pull_request' package: name: Build & verify package diff --git a/.github/workflows/title-check.yml b/.github/workflows/title-check.yml new file mode 100644 index 000000000..9a4e96b88 --- /dev/null +++ b/.github/workflows/title-check.yml @@ -0,0 +1,20 @@ +name: 'PR Title Check' +on: + pull_request: + # check when PR + # * is created, + # * title is edited, and + # * new commits are added (to ensure failing title blocks merging) + types: [opened, reopened, edited, synchronize] + +jobs: + title-check: + name: Title check + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + - name: Check PR title + env: + PR_TITLE: ${{ github.event.pull_request.title }} + run: python .github/scripts/check_pr_title.py