Motivation
Link to the gh-aw PR: github/gh-aw#47722 — fix add_comment failures for discussion targeting and workflow_dispatch PR context.
The fix resolved two root causes: (1) discussions: true was absent from the add-comment config, causing the token to lack discussions:write; (2) the agent was using the wrong context when triggered via workflow_dispatch to post a comment on a discussion. The existing test-copilot-add-discussion-comment test only uses a discussion: trigger, so the workflow_dispatch + explicit discussion number path is untested.
Proposed test
- Workflow file:
test-copilot-add-discussion-comment-dispatch.md
- Trigger:
workflow_dispatch (with a discussion_number input)
- Engine: copilot
- Safe output:
add-comment (with discussions: true)
- Variant: standard
Minimal test prompt sketch
The agent receives a discussion number via workflow_dispatch input. It posts a comment on that discussion using add_comment with the discussions permission. The test asserts the comment was created and validates that discussions: true in the safe-output config is honoured.
New fixtures or secrets needed
None. githubnext/gh-aw-test already has open discussions that can serve as the target (the harness can create one or reuse an existing fixture discussion).
Notes
The existing test-copilot-add-discussion-comment exercises the same safe output but via a discussion: event trigger. This test specifically covers the workflow_dispatch path that was broken before PR #47722.
Generated by 🔍 Suggest New E2E Tests · sonnet46 · 32.7 AIC · ⌖ 8.96 AIC · ⊞ 6.1K · ◷
Motivation
Link to the gh-aw PR: github/gh-aw#47722 — fix
add_commentfailures for discussion targeting andworkflow_dispatchPR context.The fix resolved two root causes: (1)
discussions: truewas absent from theadd-commentconfig, causing the token to lackdiscussions:write; (2) the agent was using the wrong context when triggered viaworkflow_dispatchto post a comment on a discussion. The existingtest-copilot-add-discussion-commenttest only uses adiscussion:trigger, so theworkflow_dispatch+ explicit discussion number path is untested.Proposed test
test-copilot-add-discussion-comment-dispatch.mdworkflow_dispatch(with adiscussion_numberinput)add-comment(withdiscussions: true)Minimal test prompt sketch
The agent receives a discussion number via
workflow_dispatchinput. It posts a comment on that discussion usingadd_commentwith the discussions permission. The test asserts the comment was created and validates thatdiscussions: truein the safe-output config is honoured.New fixtures or secrets needed
None.
githubnext/gh-aw-testalready has open discussions that can serve as the target (the harness can create one or reuse an existing fixture discussion).Notes
The existing
test-copilot-add-discussion-commentexercises the same safe output but via adiscussion:event trigger. This test specifically covers theworkflow_dispatchpath that was broken before PR #47722.