Skip to content

#420 follow-ups: fork_checks_ran reads base config, pull_request_target-only runs, dispatch path, nits #430

Closed

Description

@scuttletoby

Follow-ups from the two SAFE lenses on #420 (state #420 (comment), security #420 (comment)). None blocks; fix together in one small PR.

  1. minor (state 1): a PR that renames the fork-checks job or file can never pass its own fork_checks_ran job: fork-checks runs main's copy, but the job reads the PR's own config (fork-tests.yml:263, fork-checks-ran.py:112). Fix: read the config from the PR's base commit.
  2. minor (sec 1): fork-checks-ran.py:88-92 counts a fork-checks job from any event. A PR that adds push:/pull_request: to its own fork-checks.yml gets a same-named no-op job on the head that passes the check even if the real pull_request_target run was blocked. Fix: count only runs whose event is pull_request_target (test it); optionally require it as the only trigger in the contract (fork-contracts.test.py:1462).
  3. minor (sec 2): a write-access workflow_dispatch of fork-tests.yml on a PR branch puts a passing fork-ci-result on the PR head via the "not a pull request" path (fork-tests.yml:270); the ruleset matches by name only. Same path exists for other PR-only logic; decide whether dispatch on a PR head should fail closed.
  4. minor (state 2 / sec nit 4): a cancelled or failed fork-checks job counts as "ran" (fork-checks-ran.py:93); proves a job was created, not that the schema guard passed. Close with a success requirement or by making fork-checks' checks required (pull_request_target is blocked by default on public repos from 2026-12-02: keep fork checks running #401 point 4).
  5. nits: contract only pins the job's run: line and actions: read, not env / continue-on-error / if: (fork-contracts.test.py:1476); checkout keeps default persist-credentials (fork-tests.yml:261); failure message gives no recovery step (push again, or close and reopen); surviving mutant M11 (:121, message wording only); a 900 s wait cap would equal the job timeout (cancelled instead of the pull_request_target is blocked by default on public repos from 2026-12-02: keep fork checks running #401 message); PR body wording about old PRs (they pick up the job on their next push, no rebase needed).

Part of #401.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions