lean4-htt/.github
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
..
ISSUE_TEMPLATE chore: improve bug report template instructions (#11537) 2025-12-07 19:52:52 +00:00
workflows fix: use pull_request_target for label-triggered workflows (#12638) 2026-03-01 19:20:56 +11:00
actionlint.yaml chore: CI: run stage0 update on faster runner (#9178) 2025-07-03 16:14:46 +00:00
dependabot.yml chore: CI: adjust Dependabot prefix 2024-11-05 10:31:37 +01:00
PULL_REQUEST_TEMPLATE.md chore: new PR changelog template (#5976) 2024-11-07 16:59:45 +00:00