Evergreen: skip agent and conclusion when no PR needs attention#161
Merged
Conversation
Agent-Logs-Url: https://github.com/githubnext/tsessebe/sessions/ea72ea41-d795-42c3-a881-2720a3f0f05e Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix agent job to skip runs when no PRs need attention
Evergreen: skip agent and conclusion when no PR needs attention
Apr 21, 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.
At every-5-min cadence, Evergreen runs the agent even when no open PR is sick. The agent responds with prose instead of calling
noop, gh-aw treats the empty safe-outputs as failure, and a fresh false-failure issue gets filed every run.Fix: surface the pre-step's selection as a step output and gate the expensive/noisy downstream work on it.
.github/workflows/evergreen.md(source)id: find-prto the pre-step.emit_selected_output(pr_number)helper invoked at every exit path soselectedis always written to$GITHUB_OUTPUT(empty when nothing to do, PR number otherwise)..github/workflows/evergreen.lock.yml(mirrors source so the fix is effective without waiting for a gh-aw recompile)id+ emit changes inside the embedded python.selectedto anagentjob output:selected: ${{ steps.find-pr.outputs.selected }}.Execute GitHub Copilot CLIstep withif: steps.find-pr.outputs.selected != ''— skips the Copilot invocation when idle.conclusionjob condition with&& (needs.agent.outputs.selected != '' || needs.activation.outputs.lockdown_check_failed == 'true'). Theconclusionjob hostsHandle Agent Failure(the step that files the false issue); gating it here is what stops the noise. Lockdown-failure escape hatch preserved.Behavior
conclusionjob skipped → no failure issue filed, no Copilot spend.workflow_dispatch: unchanged;selectedis populated as today.Note
The
.lock.ymledit duplicates the.mdchange so the fix takes effect immediately. A subsequent gh-aw recompile will reproduce the same result from source.