Skip to content

pr-triage: a PR that GITHUB_TOKEN opens gets no triage run and no risk label #233

Closed

Description

@frostyard-machines

Problem

A PR that a workflow opens with GITHUB_TOKEN gets no PR triage run. Thus it gets no level:L1 to level:L4 label and no risk:high label until a person adds a label by hand. The PR can touch an L1 path and still show no risk label. This is a gap in the ADR-0068 and ADR-0078 contract (pr-triage spec).

Cause: GitHub creates no pull_request_target run for an event that GITHUB_TOKEN causes. The pull_request runs are created, but they wait with the conclusion action_required until a person approves them. Each caller of pr-triage.yml runs only on pull_request_target.

Evidence: frostyard/bootc-debian#24

  • The scheduled Check Upstream Versions run 42673074356 opened [ACMM L0] Add PR template #24 at 2026-11-09 18:20 UTC with peter-evans/create-pull-request and GITHUB_TOKEN. The PR changes download/checksums.json, which is download/**, level L1.
  • The pull_request runs for Build (42673133431) and ci (42673133388) were created with the conclusion action_required. They ran only after a manual approval at 2026-11-10 16:40 UTC.
  • The PR triage caller (.github/workflows/risk-paths.yml, pull_request_target, types opened, synchronize, reopened, edited, labeled) had no run for [ACMM L0] Add PR template #24 between 2026-11-09 18:20 UTC and 2026-11-10 16:35 UTC. The PR had no labels in that time.
  • At 2026-11-10 16:35 UTC, a person account added level:L1 and risk:high. That labeled event started PR triage (42855993283), and it passed.

Each repository that opens bot PRs with GITHUB_TOKEN has the same gap, for example a weekly check that bumps an upstream version.

Proposed fix

  1. Recommended: a manual trigger for triage, started by the bot workflow. Add workflow_dispatch with a pr number input to the caller template. Let pr-triage.yml read the PR from the pulls API when github.event.pull_request is absent. It already reads the risk list at the base SHA, the changed files, the rulesets and the checks through the API. Then the bot workflow starts triage after it creates or updates the PR, as bootc-debian's dispatch-build job already starts Build and ci, because an event that GITHUB_TOKEN causes through workflow_dispatch does start a run. Disadvantage: the readiness step's trigger 1 (head-moved) uses before and after from the synchronize event. With a dispatch, that step must skip trigger 1 or get the values from somewhere else.
  2. Alternative: open bot PRs with a GitHub App installation token (actions/create-github-app-token) and not with GITHUB_TOKEN. Then pull_request_target and pull_request start as usual, and the dispatch work-around in bootc-debian is not necessary. Disadvantage: the org must create an App and store its secrets (an org setting), and each bot workflow then holds a token with write access.
  3. Safety net, with 1 or 2: a scheduled sweep. It lists the open PRs that have no level:* label and writes a warning, or starts triage for each one.

Until the fix: a person or an agent must add the level label by hand on each bot PR. The labeled event then starts triage. A note in each affected repository's AGENTS.md can make this a rule.

Activity

  1. frostyard-machines commented on Nov 11, 2026

    @frostyard-machines
    ContributorAuthor

    Per-repository mitigation for 2 repositories, opened:

    In each, the check-dependencies.yml bot step (peter-evans/create-pull-request with GITHUB_TOKEN) now sets add-paths: download/checksums.json and labels: level:L1, risk:high. So the version PR has its level label and risk:high from creation, without a triage run. A guard in tests/check-baseline.sh computes the level of the add-paths from .github/risk-paths.json (rule D, plus the org floors of rule G) and fails when the labels differ, with negative tests.

    Limits:

    • This covers only these 2 repositories: in their owner's repositories, they are the only workflows that open PRs with GITHUB_TOKEN. Other repositories with the same pattern keep the gap.
    • The labels are static. A change to .github/risk-paths.json that moves the level must change the labels; the guard enforces that.
    • No triage run happens, so the readiness step also does not run on these bot PRs.

    The fleet-wide fix stays open and is not decided: a workflow_dispatch trigger for triage that the bot starts (option 1 above), a GitHub App or machine token for bot PRs (option 2), or a scheduled triage sweep (option 3). This issue stays open for that decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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