permission_check fails on fork PRs before it checks anything (checkout v7 refuses the head ref)
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 70/100
Piste de recherche
Lisez d’abord init-svc-executable-permissions.yml, puis comparez l’étape checkout dans docker-mod-builder.yml. Suivez la vérification des permissions et l’approche de la git trees API décrites dans l’issue ; c’est terminé lorsque les vérifications des permissions de fork-head fonctionnent sans checkout dangereux ni modification de la sécurité de pull_request_target, y compris les cas fork et internes documentés.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
init-svc-executable-permissions.yml fails on a fork pull request that touches run, finish, check or root/migrations/*. The job stops before any file is read, because actions/checkout@v7.0.1 refuses pull_request.head.sha in a pull_request_target workflow.
PR #190 shows it: https://github.com/linuxserver/docker-baseimage-selkies/actions/runs/33459741080/job/99707212121
The checkout step ends with:
##[error]Refusing to check out fork pull request code from a 'pull_request_target' workflow. This workflow runs with the base repository's GITHUB_TOKEN, secrets, default-branch cache scope, and runner access. Fetching and executing a fork's code in that trusted context commonly leads to "pwn request" vulnerabilities. To opt in, review the risks at https://gh.io/securely-using-pull_request_target and set 'allow-unsafe-pr-checkout: true' on the actions/checkout step.
"Check Permissions" is then skipped and the job fails. On that head SHA (a5272e08) all 13 run/finish files are 100755, so the check would have passed.
The switch to checkout 7 reached v1 with 6c9815b8 on 2026-07-03; the first fork run after that is from 2026-07-06. Since then 45 fork-head runs across linuxserver have failed and 7 internal-head runs have passed. After the switch and before that first fork run, docker-sabnzbd run 28709064096 (2026-07-04) passed: **** All perms look good ****. Twelve open fork pull requests carry a red permission_check; three more are green from before the switch.
f3577570 pinned the step to the head SHA because the check needs the PR's own files. The file modes can be read without a checkout: the git trees API on the base repository reaches the fork head through refs/pull/N/head, so the job can flag any matching blob that is not 100755 without fetching fork code. At a5272e08 it returns truncated: false, 151 entries, 13 of them run/finish blobs, all 100755. That leaves pull_request_target and the pinned ref untouched, with no allow-unsafe-pr-checkout. The same checkout step sits in docker-mod-builder.yml, which handles CR_PAT and DOCKERPASS.
- Langage dominant
- Aucune donnée de langage
- Étoiles
- 6
- Forks
- 1
- Merge moyen
- 11 h 55 min
- PR mergées (30 j)
- 3
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
NVIDIA/gpu-operator#2955 ·
-
agentic-workflows
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
automated issue report
Difficulté 1/5 1-3 heures Accessibilité débutants 76/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
dsx-ai-factory/infra-controller#6694 ·
-
bug build
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
facebookincubator/velox#19143 ·