Skip to content

feat(intake): triage an issue named by a workflow_dispatch run - #774

Merged
kyle-sexton merged 6 commits into
mainfrom
feat/intake-dispatch
Oct 18, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
feat/intake-dispatch

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Refs: #772

Summary

Events created with a job's GITHUB_TOKEN start no workflow run, except workflow_dispatch and repository_dispatch (GitHub docs, GITHUB_TOKEN: "workflow_dispatch and repository_dispatch events always create workflow runs"). The claude-code-plugins lane sweep files needs-triage issues with that token, so those issues never reach intake. This lets a caller dispatch the lane for one issue.

Stacked on #773 (base fix/intake-author-id-gate); retarget to main after it merges.

Fix

Input shape (stable; the sweep-side dispatch will be written against it):

  • Caller trigger: workflow_dispatch with one input, issue-number (string, decimal digits), passed through as the reusable's issue-number input. Nothing else is read from the dispatch.
  • Gate: a dispatch run starts only when inputs.issue-number is non-empty and the dispatching actor's numeric id (github.actor_id) is in allowed-author-ids (non-bot actor) or allowed-bot-sender-ids (actor ending [bot]), with the same malformed-list guards. Dispatching already needs write access; a stranger still cannot start a run. For a sweep that dispatches with its GITHUB_TOKEN, the caller lists github-actions[bot]'s id 41898282 (or the lanes App's id) in allowed-bot-sender-ids; only that bot's login reaches allowed_bots.
  • A new Resolve the issue step reads the issue from the API (issues.get) by the event's number or the validated input (^[1-9][0-9]{0,9}$), refuses a pull request, and supplies the number and node id every later step uses, in place of github.event.issue.*.
  • The reject step now accepts issues and workflow_dispatch; the skipped job also reports a rejected dispatch (notice and summary only, no label).

Verification

  • node --test .github/scripts/*.test.cjs: 437 pass, 0 fail. New cases: a listed person or github-actions[bot] dispatch starts a run; an unlisted actor, a person's id in the bot list (and the reverse), a missing actor id, an empty issue number and malformed lists start nothing; the issue is resolved by a validated number.
  • actionlint clean; zizmor --offline: no findings.
  • Left out: a live dispatch run. Unverified: that github.actor is github-actions[bot] when a GITHUB_TOKEN sends the dispatch, and that claude-code-action's agent mode runs on workflow_dispatch with allowed_bots set this way. Both need one live dispatch before the sweep relies on it.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_019bQ8pL7fJgVy7YjQ7wK1Zw

kyle-sexton and others added 2 commits October 17, 2026 22:12
The author gate read github.event.issue.author_association, which a
webhook computes with no viewer, so an org member with private
membership reads CONTRIBUTOR and every issue they opened was skipped
behind a green run. The gate now admits a person whose user id is in
the new allowed-author-ids input, with the same malformed-list guards
as allowed-bot-sender-ids, and drops the OWNER/MEMBER path.

A claude-intake-triage-skipped job now runs when the gate turns an
opened issue away: it names the reason in a notice and the run summary
and applies the optional skipped-label.

Refs: #772

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019bQ8pL7fJgVy7YjQ7wK1Zw
An issue created with a job's GITHUB_TOKEN starts no issues run, so the
lane never saw issues a sweep files. A caller can now dispatch the lane
with an issue-number input. The run starts only when the dispatching
actor's id is in allowed-author-ids (a person) or allowed-bot-sender-ids
(a bot), and the lane reads the issue's number and node id from the API,
refusing a malformed number or a pull request.

Refs: #772

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019bQ8pL7fJgVy7YjQ7wK1Zw
Base automatically changed from fix/intake-author-id-gate to main October 18, 2026 02:36
# Conflicts:
#	.github/scripts/intake-triage-gate.test.cjs
#	.github/workflows/intake-triage.yml
#	README.md
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 18, 2026 02:37
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T02:39:04.086050Z 4e8b515 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 3m 34s —— View job


Code review — /review:code-review (CI code-review lane)

  • Gather context (diff, CLAUDE.md/REVIEW.md, path-scoped rules, closing-issue criteria)
  • Understand the request (/review:code-review CI lane)
  • Review changed files for correctness/maintainability
  • Check path-scoped rule pr-body-contract.md against this PR body
  • Post findings (inline + summary)

Scope note: this repo runs a dedicated security lane (pr-review-security.yml), so per REVIEW.md's lane split this review covers correctness/maintainability only and leaves the gate's trust decisions (actor-id checks, allowed_bots wiring) to that lane.

Findings: none. I traced the new workflow_dispatch branch of the job-level if: gate (.github/workflows/intake-triage.yml L214-250), the new Resolve the issue step (L268-286) that replaces github.event.issue.* everywhere downstream, the allowed_bots branch added for dispatch (L457-478), and the skipped job's new dispatch-reporting path (L725-786). Each branch's gating, default step-skip-on-failure chaining, and the skipped-job condition line up with the PR body's stated behavior, and the new test cases in intake-triage-gate.test.cjs exercise the added branches (listed person/bot dispatch, unlisted actor, person-id-in-bot-list and reverse, missing actor id, empty issue-number, malformed lists, and the API-resolved number).

PR body contract: complies — opens with Refs: #772, followed by ## Summary, ## Fix, ## Verification, ## Related.

Verification I could not independently confirm: this sandbox's Bash tool required approval for node --test …, python3, and similar execution commands, and none was granted, so I was unable to run the test suite, actionlint, or zizmor myself. The "437 pass, 0 fail" / "actionlint clean" / "zizmor clean" results in the PR body are author-claimed and unverified by this review. The author's own "Left out" caveats (no live dispatch run; unverified github.actor identity under a GITHUB_TOKEN-sent dispatch, and allowed_bots behavior on workflow_dispatch) are already disclosed in the PR body and not repeated here as new findings.
· branch feat/intake-dispatch

@claude

claude Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 6m 28s —— View job


Security review — no findings

  • Gather context (diff, changed files, CLAUDE.md/AGENTS.md rules)
  • Understand the request (invoke /review:security-review for this PR)
  • Review intake-triage.yml gate/dispatch logic for authz gaps
  • Review Resolve the issue step and input validation
  • Check instruction-surface deletions against protected classes
  • Adversarially verify any candidate findings (independent hunter pass)
  • Post final findings

This PR adds a workflow_dispatch path to the intake-triage reusable workflow so a caller can triage one issue by number (needed because issues filed with a job's GITHUB_TOKEN never start an issues run). I reviewed all three changed files (.github/workflows/intake-triage.yml, .github/scripts/intake-triage-gate.test.cjs, README.md) against origin/main, then had an independent review:lane-verifier hunter re-check the same surface from scratch. Both passes reached the same conclusion: no CRITICAL or IMPORTANT finding.

What I scrutinized specifically:

  • Job-level if: gate (intake-triage.yml#L214-L250): every branch of the new workflow_dispatch clause is fully parenthesized, so there's no &&/|| precedence leak between the person-branch (allowed-author-ids) and bot-branch (allowed-bot-sender-ids), each with its own malformed-list guards — the same pattern as the pre-existing issues-event gate, correctly extended.
  • Trust-boundary narrowing vs. the issues path: the workflow_dispatch branch has no analogue of the issues path's "sender must be the issue's own author" check, so a listed dispatcher can triage any issue number, not just their own. This isn't independently exploitable: triggering workflow_dispatch (UI or API) already requires write access to the caller's repo, and that same access already lets an actor label/comment on any issue directly — routing it through intake-triage adds no write capability the actor didn't already have, and the Claude step stays read-only (--permission-mode dontAsk, no write tools). Intentional and documented at intake-triage.yml#L68-L74.
  • Input validation / injection: the new Resolve the issue step (intake-triage.yml#L268-L286) is the only consumer of the raw inputs.issue-number; it validates against ^[1-9][0-9]{0,9}$ and returns before any API call on failure. Every downstream step (the Claude prompt, the apply-triage step) reads the resolved steps.issue.outputs.number/node-id, never the raw input directly. The one place raw inputs.issue-number still appears is the skipped-job's notice/summary text for a rejected dispatch (intake-triage.yml#L759-L766) — plain log text, that branch returns before reaching any issues.* write.
  • github.actor/github.actor_id are GitHub-runtime-populated from the real triggering identity, not forgeable via dispatch inputs.
  • Instruction-surface check: no standing guardrail was removed or narrowed — the Reject events other than issues step's scope was widened to also accept workflow_dispatch, but that's paired with the new gate above, not a softening of an existing check.

GitHub Actions hardening concerns (permission widening, unpinned actions, dangerous triggers) are out of scope here per this lane's contract with zizmor, which the PR description reports clean.

@github-actions

Copy link
Copy Markdown

claude-review has reviewed this pull request through 4e8b515; a later push is reviewed from there.

@github-actions

Copy link
Copy Markdown

claude-security-review has reviewed this pull request through 4e8b515; a later push is reviewed from there.

@kyle-sexton
kyle-sexton merged commit ff8cd36 into main Oct 18, 2026
29 checks passed
@kyle-sexton
kyle-sexton deleted the feat/intake-dispatch branch October 18, 2026 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant