Skip to content

Fail add-comment when the triggering target cannot be resolved - #65068

Merged
pelikhan merged 9 commits into
mainfrom
copilot/fix-safe-output-comment-triggering
Oct 2, 2026
Merged

pelikhan merged 9 commits into
mainfrom
copilot/fix-safe-output-comment-triggering

Conversation

Copilot AI commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

add-comment could silently skip target: "triggering" outside an issue or PR context, leaving the workflow green without posting a required comment.

  • Failure behavior: Return a fatal error with guidance to configure an explicit target when no triggering context is available.
  • Scope: Preserve existing behavior for explicit targets and other safe-output types.

Run: https://github.com/github/gh-aw/actions/runs/37041488340

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 18.3 AIC · ⌖ 8.67 AIC · ⊞ 9.7K · ◷
Comment /souschef to run again


add-comment could silently skip target: "triggering" outside an issue or PR context, leaving the workflow green without posting a required comment.


Run: https://github.com/github/gh-aw/actions/runs/37041488340

Generated by 👨🍳 PR Sous Chef · pi · gpt54 · 18.3 AIC · ⌖ 8.67 AIC · ⊞ 9.7K · ◷
Comment /souschef to run again

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 17.4 AIC · ⌖ 8.64 AIC · ⊞ 9.7K · ◷
Comment /souschef to run again

Copilot AI changed the title [WIP] Fix safe-output add-comment for triggering contexts Fail add-comment when the triggering target cannot be resolved Oct 2, 2026
Copilot AI requested a review from pelikhan October 2, 2026 17:25
@pelikhan
pelikhan marked this pull request as ready for review October 2, 2026 17:27
Copilot AI balanced review requested due to automatic review settings October 2, 2026 17:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused change preserves explicit-target behavior and adequately tests the corrected failure path.

Review effort: Balanced
Findings: None

What changed in this PR

Makes unresolved triggering targets fatal for add-comment, preventing false-green workflows.

Changes:

  • Returns an actionable failure instead of skipping unresolved triggering targets.
  • Adds coverage for schedule and dispatch events.
File Description
actions/​setup/​js/​add_comment.cjs Converts missing triggering context into a fatal handler result.
actions/​setup/​js/​add_comment.test.cjs Verifies failure behavior across unsupported event contexts.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Branch refresh has been requested for this PR. Please verify the updated branch state and run the pr-finisher skill before handing off.

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 18.3 AIC · ⌖ 8.67 AIC · ⊞ 9.7K · ◷
Comment /souschef to run again

Copilot AI commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Branch refresh has been requested for this PR. Please verify the updated branch state and run the pr-finisher skill before handing off.

Generated by [👨‍🍳 PR Sous Chef](https://gi...

Verified refresh commit 5206c50 includes the current main tip and preserves the two-file fix. Ran pr-finisher and copilot-review: no unresolved threads or new findings; formatting, lint, and 246 targeted JavaScript tests passed (3 skipped). Impacted Go validation found no changed Go files. Working tree is clean; no additional edits were needed. The refreshed HEAD’s CJS run is action_required with no jobs/logs, so required CI remains unverified and the PR is still blocked.

Copilot AI requested a review from gh-aw-bot October 2, 2026 17:55
@pelikhan

pelikhan commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

@copilot the safe output mcp server should detect this issue when the add_comment call is made and return a actionable response to the agent.t

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Please take another pass on this PR. The branch was queued for refresh; once it settles, verify CI remains green and run the pr-finisher skill before handing back to maintainers.

Generated by PR Sous Chef for #65068: Fail add-comment when the triggering target cannot be resolved

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 17.4 AIC · ⌖ 8.64 AIC · ⊞ 9.7K · ◷
Comment /souschef to run again

Copilot AI commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot the safe output mcp server should detect this issue when the add_comment call is made and return a actionable response to the agent.t

Implemented in a16ba2c. The MCP add_comment call now rejects unresolved triggering targets before recording output and returns isError: true with guidance to configure safe-outputs.add-comment.target: "*" and provide item_number, or use create_issue/create_discussion. This also catches missing target numbers and dispatch overrides without target context. Explicit configured targets remain supported. All 420 targeted tests passed; JavaScript CodeQL found no alerts.

Copilot AI commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Please take another pass on this PR. The branch was queued for refresh; once it settles, verify CI remains green and run the pr-finisher skill before handing back to maintainers.

Generated...

Verified refresh commit 79eaf8c includes base tip cd3a649; HEAD is a16ba2c, including the MCP call-time fix. Ran pr-finisher and copilot-review: no review threads or new findings; local build, formatting, lint, schema checks, and all 420 targeted JavaScript tests passed. Working tree is clean; no additional edits were needed. CI is not confirmed green: HEAD’s CJS run 37058971883 is action_required with no jobs/logs, and security scanning was still running. The PR remains blocked.

@pelikhan
pelikhan merged commit 93e3a79 into main Oct 2, 2026
11 checks passed
@pelikhan
pelikhan deleted the copilot/fix-safe-output-comment-triggering branch October 2, 2026 20:40
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.90.3

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.

safe-output add-comment with target "triggering" silently skips and succeeds green outside issue/PR context

4 participants