You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[plan] Add no-op early exit guard to Hourly CI Cleaner #7413
Add an early exit mechanism to the Hourly CI Cleaner workflow that skips execution when there is no work to do, preventing unnecessary token consumption.
Context
The Copilot Token Report (discussion #7407) recommends adding a no-op exit guard to the Hourly CI Cleaner. This will prevent the workflow from consuming tokens when there are no CI runs to clean up.
Approach
Add a preliminary step that checks if there are CI runs to clean
Use GitHub API to query for qualifying runs
If no runs found, exit early with success status
Document the no-op behavior in workflow comments
Implementation Strategy
Add an early check before the main Copilot agent execution:
steps:
- name: Check for CI runs to cleanid: checkrun: | # Query for qualifying CI runs count=$(gh api ... | jq 'length') echo "count=$count" >> $GITHUB_OUTPUT
- name: Run CI Cleanerif: steps.check.outputs.count > 0# ... existing Copilot agent execution
Files to Modify
Hourly CI Cleaner workflow file (identified in previous issue)
Acceptance Criteria
Workflow checks for work before executing
Early exit occurs when no CI runs need cleaning
Token consumption drops for no-op runs
Workflow still cleans CI runs when work exists
Logs clearly indicate no-op vs. execution runs
Expected Impact
Further reduces token consumption beyond schedule changes
Activity