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