fix(keepalive): use always() to ensure reusable workflow job is created#110
fix(keepalive): use always() to ensure reusable workflow job is created#110
Conversation
GitHub Actions evaluates if conditions for reusable workflow jobs at workflow startup time, potentially before dependency outputs are available. Using always() ensures the job is created in the workflow graph, while the rest of the condition determines if it actually runs. This fixes the issue where Keepalive next task job wasn't being created even when evaluate.outputs.action was 'run'.
Automated Status SummaryHead SHA: ac7aa22
Coverage Overview
Coverage Trend
Updated automatically; will refresh on subsequent CI/Docker completions. Keepalive checklistScopeNo scope information available Tasks
Acceptance criteria
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a GitHub Actions workflow issue where the Keepalive next task job was not appearing in workflow runs even when the condition should have evaluated to true. The root cause was that GitHub Actions evaluates if: conditions for reusable workflow jobs at workflow startup time, before dependency job outputs are available.
Key changes:
- Updated the
if:condition on therun-codexjob to usealways()combined with explicit success and output checks
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| needs: | ||
| - evaluate | ||
| if: needs.evaluate.outputs.action == 'run' | ||
| if: ${{ always() && needs.evaluate.result == 'success' && needs.evaluate.outputs.action == 'run' }} |
There was a problem hiding this comment.
The ${{ }} expression wrapper is redundant in the if: condition since GitHub Actions already evaluates expressions in this context. For consistency with other conditions in this workflow (lines 126 and 174), consider removing the wrapper to use: if: always() && needs.evaluate.result == 'success' && needs.evaluate.outputs.action == 'run'
| if: ${{ always() && needs.evaluate.result == 'success' && needs.evaluate.outputs.action == 'run' }} | |
| if: always() && needs.evaluate.result == 'success' && needs.evaluate.outputs.action == 'run' |
Problem
After PR #109, the
Keepalive next taskjob still wasn't appearing in workflow runs even whenevaluate.outputs.action == 'run'.Root Cause
GitHub Actions evaluates
if:conditions for reusable workflow jobs at workflow startup time, potentially before dependency job outputs are available. This means:if: needs.evaluate.outputs.action == 'run'is evaluated BEFORE evaluate runsactionis empty/undefined, so the condition is falseEvidence
action: 'run',reason: 'ready'Keepalive next taskwas missing from the job graph entirelySolution
Use
always()to ensure the job is always created in the workflow graph:The
always()forces job creation. The rest of the condition determines if it actually runs once evaluate completes.Automated Status Summary
Scope
Tasks
Acceptance criteria
Head SHA: 83cc76d
Latest Runs: ✅ success — Gate
Required: gate: ✅ success