Skip to content

Route private-repo comment-event jobs to self-hosted runners (Actions budget capped at $0) #217

Closed

Description

@kyle-sexton

Context

Org GitHub Actions spending is capped at $0 (free private-repo minutes only, by design). The governed runner policy is already self-hosted-only, so private-repo required checks run on the self-hosted fleet and are unaffected. But jobs the selector treats as never-self-hosted-eligible — comment/review-event jobs (issue_comment, pull_request_review, pull_request_review_comment) — fall back to hosted runners and now fail at startup with "The job was not started because recent account payments have failed or your spending limit needs to be increased" whenever free minutes are exhausted. Observed live 2026-07-22 on medley's advisory resolve-on-comment jobs (comment-review-gate.yml): 0-step, ~2s startup failures polluting every PR's check list. Public repos are unaffected (unlimited free hosted minutes).

Proposed work

  • Make comment/review-event jobs self-hosted-eligible in the select-runner reusable for private repos, OR provide a policy knob for it. Security review required: these events carry no untrusted checkout in the affected jobs (pure API calls), and all actors in private fleet repos are org members/trusted apps — validate that reasoning before widening eligibility.
  • Port the consumer jobs' bare gh invocations to actions/github-script first (the Audit remaining gh-calling reusables for the bare-gh runner assumption (post-#144) #209 pattern) — the self-hosted image ships no gh CLI, so rerouting without porting reproduces the exit-127 defect class (fix(do-not-merge-gate): drop gh CLI dependency from label refetch #144). Known consumer: medley .github/workflows/comment-review-gate.yml (resolve jobs + create-or-resolve matrix job).
  • Sweep other private repos (github-iac, dotfiles, provisioning) for hosted-fallback event jobs with the same exposure.

Acceptance criteria

  • No private-repo workflow job routes to a GitHub-hosted runner under the current policy (verified by a fleet run sweep after rollout)
  • medley comment-review-gate jobs run green on self-hosted with zero runner-tool assumptions
  • Billing-startup check failures no longer appear on private-repo PRs

References

Activity

  1. added theissue type on Jul 22, 2026
  2. added
    needs-triage
    on Jul 22, 2026
  3. kyle-sexton commented on Jul 22, 2026

    @kyle-sexton
    MemberAuthor

    Implementation note on scope: PR #224 does not make comment/review-event routing eligibility blanket. It adds an opt-in admits-comment-events input (default false) to select-runner.yml, and only medley's comment-review-gate.yml (medley#1632, verified zero checkout, pure API calls) is intended to set it once medley repins.

    Why not blanket: auditing fleet consumers of this selector surfaced medley's .github/workflows/claude-assistant.yml, which also triggers on issue_comment/pull_request_review_comment, already calls this same selector, and checks out the repository + runs Claude with contents: write and commit signing. Under the current self-hosted-only policy that job is dormant today (comment events route hosted, so its route == 'self-hosted' gate never passes). Blanket-admitting the event classes -- the originally scoped approach -- would have flipped that dormant job live as a side effect: comment-triggered checkout + code execution + write perms on the self-hosted fleet, with no dedicated security review of that specific exposure.

    Explicitly recording: claude-assistant.yml is untouched by #224 and stays exactly as dormant as it is today. It would only ever become self-hosted-eligible via its own future, deliberate opt-in (setting admits-comment-events: true on its own select-runner call) -- that is a separate decision requiring its own security review of checkout+write-on-fleet, not something this issue's fix does for it.

    🤖 Generated with Claude Code

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

    needs-triage

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions