Add no-op early exit guard to Hourly CI Cleaner#7425
Merged
Conversation
- Remove exit 1 from CI check step to allow graceful continuation - Add conditional execution (if: env.CI_NEEDS_FIX == 'true') to all setup steps - Update workflow description to mention early exit behavior - Add comments explaining early exit guard mechanism - Update agent prompt to check CI status and exit early if passing - Prevents token consumption when CI is healthy Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
… passing Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add no-op early exit guard to Hourly CI Cleaner
Add no-op early exit guard to Hourly CI Cleaner
Dec 23, 2025
pelikhan
reviewed
Dec 23, 2025
| @@ -31,6 +31,8 @@ sandbox: | |||
| - "/usr/local/lib/node_modules:/usr/local/lib/node_modules:ro" | |||
| - "/opt/hostedtoolcache/go:/opt/hostedtoolcache/go:ro" | |||
| steps: | |||
Contributor
There was a problem hiding this comment.
@copilot move early exit check in pre_activation job
Contributor
Author
There was a problem hiding this comment.
Done in commit 302538c. Moved the CI check to a check_ci_status job that runs before the agent. The agent job now has a job-level if: condition and only executes when ci_needs_fix == 'true', providing a true early exit without starting the agent container.
- Create check_ci_status job that runs before agent - Add job-level if condition to skip agent when CI is passing - Remove conditional checks from individual setup steps - Update prompt to reference check_ci_status outputs - Agent job now depends on check_ci_status and only runs when ci_needs_fix=true Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
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.
Prevents unnecessary token consumption when CI is passing on main. The workflow was executing the full agent on every scheduled run, even when no fixes were needed.
Changes
Created pre-activation job for CI status check
check_ci_statusjob that runs before the agentci_needs_fix,ci_status, andci_run_idfor use by agent jobAdded job-level conditional to agent
check_ci_status(in addition toactivation)if: needs.check_ci_status.outputs.ci_needs_fix == 'true'conditionSimplified agent prompt
Behavior
When CI is passing:
When CI is failing:
Combined with the 2-3 hour schedule reduction (#7410), this eliminates wasteful execution while maintaining CI health.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.