lean4-htt/.github/workflows
Kim Morrison feea8a7611
fix: use pull_request_target for label-triggered workflows (#12638)
This PR switches four lightweight workflows from `pull_request` to
`pull_request_target` to stop GitHub from requiring manual approval when
the
`mathlib-lean-pr-testing[bot]` app triggers label events (e.g. adding
`builds-mathlib`). Since the bot never lands commits on master, it is
perpetually treated as a "first-time contributor" and every
`pull_request`
event it triggers requires approval. `pull_request_target` events always
run
without approval because they execute trusted code from the base branch.

This is safe for all four workflows because none check out or execute
code
from the PR branch — they only read labels, PR body, and file lists from
the
event payload and API:

- `awaiting-mathlib.yml` — checks label combinations
- `awaiting-manual.yml` — checks label combinations
- `pr-body.yml` — checks PR body formatting
- `check-stdlib-flags.yml` — checks if stdlib_flags.h was modified via
API

Also adds explicit `permissions: pull-requests: read` to each workflow
as a
least-privilege hardening measure, since `pull_request_target` has
access to
secrets.

Addresses the issue reported by Sebastian:

https://lean-fro.zulipchat.com/#narrow/channel/398861-general/topic/mathlib.20pr-testing.20breakage.3F/near/575084348

🤖 Prepared with Claude Code

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 19:20:56 +11:00
..
actionlint.yml chore: CI: bump actions/checkout from 5 to 6 (#11459) 2026-01-09 07:43:13 +00:00
awaiting-manual.yml fix: use pull_request_target for label-triggered workflows (#12638) 2026-03-01 19:20:56 +11:00
awaiting-mathlib.yml fix: use pull_request_target for label-triggered workflows (#12638) 2026-03-01 19:20:56 +11:00
backport.yml chore: CI: add backport action 2023-09-25 11:33:14 +02:00
build-template.yml chore: fix ci for new test suite (#12704) 2026-02-27 23:25:37 +00:00
check-prelude.yml chore: CI: bump actions/checkout from 5 to 6 (#11459) 2026-01-09 07:43:13 +00:00
check-stage0.yml chore: CI: bump actions/checkout from 5 to 6 (#11459) 2026-01-09 07:43:13 +00:00
check-stdlib-flags.yml fix: use pull_request_target for label-triggered workflows (#12638) 2026-03-01 19:20:56 +11:00
ci.yml chore: fix ci for new test suite (#12704) 2026-02-27 23:25:37 +00:00
copyright-header.yml chore: CI: bump actions/checkout from 5 to 6 (#11459) 2026-01-09 07:43:13 +00:00
grove.yml chore: ci: bump grove-action to v0.5 (#11559) 2025-12-09 10:33:31 +00:00
jira.yml chore: CI: Jira sync 2024-07-24 19:52:55 +02:00
labels-from-comments.yml chore: CI: bump actions/github-script from 7 to 8 (#10648) 2025-10-07 11:41:04 +00:00
pr-body.yml fix: use pull_request_target for label-triggered workflows (#12638) 2026-03-01 19:20:56 +11:00
pr-release.yml chore: revert "chore: CI: avoid fetching full repo in PR Release (#12309)" 2026-02-09 13:12:35 +00:00
pr-title.yml chore: adjust pr-title check to enforce capitalization (#11033) 2025-10-31 07:23:25 +00:00
restart-on-label.yml chore: restart-on-label: Also filter by commit SHA (#5099) 2024-08-20 07:45:43 +00:00
stale.yml chore: CI: bump actions/stale from 9 to 10 (#10647) 2025-10-07 11:41:31 +00:00
update-stage0.yml chore: CI: bump actions/cache from 4 to 5 (#11862) 2026-02-03 12:37:56 +00:00