From 11375593dcd0b4daf8532ad22969c0b4ab5c68f4 Mon Sep 17 00:00:00 2001 From: Tim Diekmann Date: Fri, 22 May 2026 20:07:35 +0200 Subject: [PATCH 1/2] =?UTF-8?q?SRE-720:=20Simplify=20PR-title=20preflight?= =?UTF-8?q?=20=E2=80=94=20drop=20two-step=20skip=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Folds the bot-author check into the job-level `if:` and removes the separate "Determine whether to skip" step plus the unused `ignored-actors` workflow input. One step (validate), one condition, same behavior for human + bot authors. If a future case needs to exempt a human account, it's a trivial `&&` on the `if:` to add it back. --- .github/workflows/preflight-pr-title.yml | 43 +----------------------- 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/.github/workflows/preflight-pr-title.yml b/.github/workflows/preflight-pr-title.yml index c94ea5c..7d3eaac 100644 --- a/.github/workflows/preflight-pr-title.yml +++ b/.github/workflows/preflight-pr-title.yml @@ -20,16 +20,6 @@ on: types: [opened, synchronize, reopened, edited] merge_group: workflow_call: - inputs: - ignored-actors: - description: | - Additional GitHub logins to exempt from the check, as a - newline- or comma-separated list. GitHub App accounts - (`pull_request.user.type == 'Bot'`) are always skipped, so - this is only needed for human accounts that should be exempt. - type: string - required: false - default: "" permissions: contents: read @@ -38,40 +28,9 @@ jobs: check: name: Linear Issue ID runs-on: ubuntu-24.04 - if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' + if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.pull_request.user.type != 'Bot' steps: - - name: Determine whether to skip the check - id: skip - env: - PR_USER: ${{ github.event.pull_request.user.login }} - PR_USER_TYPE: ${{ github.event.pull_request.user.type }} - EXTRA_IGNORED: ${{ inputs.ignored-actors }} - run: | - echo "PR author: $PR_USER (type: $PR_USER_TYPE)" - - if [[ "$PR_USER_TYPE" == "Bot" ]]; then - echo "::notice::Skipping check — PR authored by a bot account ($PR_USER)." - echo "skip=true" >> "$GITHUB_OUTPUT" - exit 0 - fi - - if [[ -n "$EXTRA_IGNORED" ]]; then - EXTRA_NORMALIZED=$(printf '%s' "$EXTRA_IGNORED" \ - | tr ',' '\n' \ - | sed 's/^[[:space:]]*//; s/[[:space:]]*$//' \ - | sed '/^$/d') - - if echo "$EXTRA_NORMALIZED" | grep -qFx "$PR_USER"; then - echo "::notice::Skipping check — PR author $PR_USER is in the ignored-actors list." - echo "skip=true" >> "$GITHUB_OUTPUT" - exit 0 - fi - fi - - echo "skip=false" >> "$GITHUB_OUTPUT" - - name: Validate PR title contains Linear issue ID - if: steps.skip.outputs.skip != 'true' env: PR_TITLE: ${{ github.event.pull_request.title }} run: | From c1d7116c16e56eee39fcbb4d70f576e87d7ba526 Mon Sep 17 00:00:00 2001 From: Tim Diekmann Date: Fri, 22 May 2026 20:11:35 +0200 Subject: [PATCH 2/2] Update header comment to drop ignored-actors reference --- .github/workflows/preflight-pr-title.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/preflight-pr-title.yml b/.github/workflows/preflight-pr-title.yml index 7d3eaac..216f420 100644 --- a/.github/workflows/preflight-pr-title.yml +++ b/.github/workflows/preflight-pr-title.yml @@ -5,10 +5,9 @@ # before the first ":". Mirrors the prefix-parsing convention already used by # `preflight-todo-comments.yml`, so the same IDs power both checks. # -# Bot-authored PRs are skipped by default (any account where +# Bot-authored PRs are skipped (any account where # `pull_request.user.type == 'Bot'`, which covers `hash-worker[bot]`, -# `dependabot[bot]`, and any other GitHub App). Additional user logins can be -# skipped via the `ignored-actors` input. +# `dependabot[bot]`, and any other GitHub App). name: PR Title on: