ci: gate nix-build on same-repo PRs only

scripts/update-nix.sh and scripts/fix-lockfile.mjs are executed from
the PR's checked-out tree. A fork PR can modify those scripts to run
arbitrary code on the runner. Same-repo PRs and push-to-main still
run; fork PRs skip the job entirely.

Closes #365.
This commit is contained in:
Mohamed Boudra
2026-05-12 12:37:01 +07:00
parent e0361ddd22
commit ed1943058a

View File

@@ -37,6 +37,11 @@ permissions:
jobs:
build:
# Skip fork PRs: this workflow executes scripts/update-nix.sh and
# scripts/fix-lockfile.mjs from the checked-out tree. A fork could
# edit those to run arbitrary code on the runner. Same-repo PRs and
# main pushes still run.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1