Remove the `pull_request_target` workflow before GitHub blocks it

Aperta Adatta ai principianti
#489 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@jat255 ci sta già lavorando.

Dal 7/11/2026.

  • #490 di @jat255 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github-actions, python
Ambito
ci-cd

Direzione di ricerca

Leggi .github/workflows/preview-fork-notice.yml e .github/workflows/py-docs.yaml per vedere come funziona il workflow di avviso e dove il workflow della documentazione scrive il riepilogo dell’esecuzione. Rimuovi il workflow di avviso e aggiorna il riepilogo per informare gli autori dei fork che il loro PR non riceve un’anteprima. Il lavoro è completato quando il workflow separato è stato rimosso e le esecuzioni delle PR dei fork mostrano quel messaggio nel riepilogo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

From December 2, 2026, GitHub blocks pull_request_target workflows in public repositories unless an Actions policy allows them (GitHub docs). Our only such workflow is preview-fork-notice.yml, and each of its runs already shows a warning about this.

That workflow is safe, but asking for a policy exception to keep a one-line comment is not worth it. The exception would also cover any future pull_request_target workflow, including one that is not safe. I propose that we remove the workflow, and that py-docs.yaml tells fork authors in its run summary that their PR gets no preview.

Why GitHub restricts pull_request_target (agent-written)

A pull_request_target workflow runs in the context of the base repository. It gets a GITHUB_TOKEN that can write and it can read the repository's secrets, even when the PR comes from a fork. The workflow file comes from the base branch, so a fork cannot change it.

The risk is a workflow that checks out the PR's code and then runs it (an install, a build, a test suite, or a tool that reads config from the repository). The attacker's code then runs with write access and secrets. It can push to main, read deploy keys, or poison the Actions cache. This pattern is called a "pwn request", and it caused real supply-chain attacks. A related risk is PR text, such as a title or a branch name, put directly into a run: script with ${{ }}.

preview-fork-notice.yml does none of this. It never checks out the PR and runs no PR code. The new default looks only at the event, so it blocks safe and unsafe workflows the same way.

Lingua principale
Python
Stelle
69
Fork
5
Merge medio
5g 3h
PR unite (30g)
33

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di posit-dev/commons

Tutte le issue di posit-dev/commons

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.