fix: silently skip add_comment when no triggering context (schedule runs)#24098
Merged
fix: silently skip add_comment when no triggering context (schedule runs)#24098
Conversation
…xt on schedule runs
When target is 'triggering' but running in a non-issue/PR context (e.g. schedule),
resolveTarget returns shouldFail: false. Previously the handler returned
{ success: false } without skipped: true, causing the handler manager to count
it as a failure and exit non-zero.
Now, when shouldFail is false, we return { success: false, skipped: true } so the
handler manager treats it as an expected skip rather than a failure.
Fixes smoke-multi-pr failures on schedule runs caused by status-comment: true
generating add_comment with target: triggering.
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/970c0b44-0e7f-4791-a736-472980d590ed
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Closed
Copilot
AI
changed the title
[WIP] Fix safe_outputs failure on scheduled runs
fix: silently skip add_comment when no triggering context (schedule runs)
Apr 2, 2026
Copilot stopped work on behalf of
pelikhan due to an error
April 2, 2026 12:30
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes add_comment safe output handling so schedule-triggered runs with target: triggering gracefully skip (instead of failing) when there’s no issue/PR context.
Changes:
- Update
add_comment.cjsto honorresolveTarget()’sshouldFailsignal and return{ skipped: true }for expected “no triggering context” cases. - Downgrade logging for this skip path from
core.warningtocore.info. - Add a regression test covering schedule context behavior for
target: triggering.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| actions/setup/js/add_comment.cjs | Uses shouldFail to distinguish between real failures vs expected skips; returns skipped: true for schedule/no-context runs. |
| actions/setup/js/add_comment.test.cjs | Adds coverage asserting schedule-context + target: triggering yields skipped: true and no warning is emitted. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On schedule-triggered runs,
status-comment: truegenerates anadd_commentsafe output withtarget: triggering, but there's no issue/PR context — causing safe_outputs to exit non-zero instead of skipping gracefully.Root cause:
resolveTarget()already returns{ shouldFail: false }for this case, signaling "skip, don't fail." Butadd_comment.cjsignoredshouldFailand returned{ success: false }withoutskipped: true, so the handler manager counted it as a real failure.Fix (
add_comment.cjs):The
skipped: trueflag is what the handler manager uses to distinguish an expected skip from a counted failure. Also switches fromcore.warningtocore.infosince this is not an error condition.Test added: Schedule-event context with
target: triggeringnow assertsresult.skipped === trueand that nocore.warningis emitted for the skip message.