From 7aab9f3d538db6952eb24b053c2bb5e5f544a980 Mon Sep 17 00:00:00 2001 From: Laurent Giovannoni Date: Thu, 3 Dec 2026 12:03:21 +0100 Subject: [PATCH] ci(github): run the PR automation on pull_request instead of pull_request_target (#397) GitHub blocks pull_request_target by default on public repositories from 2 December 2026. Auto Label and Check Signed Commits now run on pull_request. Same-repo PRs keep their write token from the declared permissions; fork PRs, whose token is read-only, are skipped where a write is needed. --- .github/workflows/openaev-auto-label.yml | 7 ++++++- .github/workflows/openaev-check-signed-commit.yml | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/openaev-auto-label.yml b/.github/workflows/openaev-auto-label.yml index 63849af6..8dd59f4a 100644 --- a/.github/workflows/openaev-auto-label.yml +++ b/.github/workflows/openaev-auto-label.yml @@ -1,6 +1,10 @@ name: "[OpenAEV] Auto Label" +# Runs on `pull_request`, not `pull_request_target`: GitHub blocks the latter by default on +# public repositories. Fork PRs get a read-only token and cannot be labeled, so they are skipped. +# A PR with a merge conflict starts no `pull_request` run: one opened or reopened in that state +# is not labeled. Add the label by hand. on: - pull_request_target: + pull_request: branches: [main] types: [opened, reopened] permissions: @@ -8,6 +12,7 @@ permissions: pull-requests: write jobs: auto-label: + if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest steps: - name: "Auto Label" diff --git a/.github/workflows/openaev-check-signed-commit.yml b/.github/workflows/openaev-check-signed-commit.yml index 794aa34b..36029ddb 100644 --- a/.github/workflows/openaev-check-signed-commit.yml +++ b/.github/workflows/openaev-check-signed-commit.yml @@ -1,6 +1,9 @@ name: "[OpenAEV] Check Signed Commits in PR" +# Runs on `pull_request`, not `pull_request_target`: GitHub blocks the latter by default on +# public repositories. On fork PRs the token is read-only, so the check still fails on an unsigned +# commit but cannot post its explanatory comment. The merge itself is enforced by the ruleset. on: - pull_request_target: + pull_request: branches: [main] permissions: contents: read