Skip to content

Suggested test: copilot/add-discussion-comment-dispatch #9063

Description

@github-actions

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 ·

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions