Skip to content

Commit 11a670a

Browse files
justin808claude
andcommitted
Fix /run-skipped-ci to trigger all workflows on fresh PRs
Previously, when /run-skipped-ci was used on a fresh PR where no checks had run yet, the workflow would: 1. Add the full-ci label 2. Report "All checks are already running - nothing to do!" 3. Not actually trigger any workflows This was confusing because users expected the Pro tests to run immediately, but they would only run on the next commit. Now the workflow: - Detects when there are no skipped checks (fresh PR scenario) - Triggers ALL workflows in the workflowMap to ensure full coverage - Updates the status message to "Triggered all workflows for full CI coverage" - Still triggers only specific skipped workflows when they exist This ensures that /run-skipped-ci always triggers the workflows immediately, whether it's a fresh PR or one with existing skipped checks. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 08e5fd7 commit 11a670a

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

.github/workflows/run-skipped-ci.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,18 @@ jobs:
133133
const failed = [];
134134
const notApplicable = [];
135135
136-
// Trigger each workflow that has skipped checks
137-
for (const workflowName of uniqueWorkflows) {
136+
// If no skipped checks found, trigger ALL workflows in the map
137+
// This handles the case where workflows haven't run yet (e.g., Pro tests on fresh PRs)
138+
const workflowsToTrigger = uniqueWorkflows.size > 0
139+
? Array.from(uniqueWorkflows)
140+
: Object.keys(workflowMap);
141+
142+
if (uniqueWorkflows.size === 0) {
143+
console.log('ℹ️ No skipped checks found - triggering all workflows to ensure full coverage');
144+
}
145+
146+
// Trigger each workflow
147+
for (const workflowName of workflowsToTrigger) {
138148
const workflowFile = workflowMap[workflowName];
139149
try {
140150
await github.rest.actions.createWorkflowDispatch({
@@ -154,12 +164,6 @@ jobs:
154164
}
155165
}
156166
157-
// Note workflows with no skipped checks
158-
if (uniqueWorkflows.size === 0) {
159-
console.log('ℹ️ No skipped checks found - all tests already running on this PR');
160-
notApplicable.push('No skipped checks to run');
161-
}
162-
163167
// Wait a bit for workflows to queue
164168
if (succeeded.length > 0) {
165169
console.log('Waiting 5 seconds for workflows to queue...');
@@ -195,14 +199,14 @@ jobs:
195199
196200
// Build the comment body based on actual results
197201
let status;
198-
if (notApplicable.length > 0) {
199-
status = '✅ **All checks are already running - nothing to do!**';
200-
} else if (failed.length > 0 && notFound.length > 0) {
202+
if (failed.length > 0 && notFound.length > 0) {
201203
status = '❌ **Failed to trigger or verify workflows**';
202204
} else if (failed.length > 0) {
203205
status = '⚠️ **Some workflows failed to trigger**';
204206
} else if (notFound.length > 0) {
205207
status = '⚠️ **Workflows triggered but not yet verified**';
208+
} else if (uniqueWorkflows.size === 0) {
209+
status = '✅ **Triggered all workflows for full CI coverage**';
206210
} else {
207211
status = '✅ **Successfully triggered skipped CI checks**';
208212
}
@@ -234,13 +238,11 @@ jobs:
234238
${skippedChecksList}
235239
${verifiedList}${notFoundList}${failedList}
236240
237-
${labelAdded && verified.length > 0 ? `\n**Note:** Added the \`full-ci\` label to this PR. All future commits will run the full CI suite (including minimum dependency tests) until the label is removed.
241+
${labelAdded && succeeded.length > 0 ? `\n**Note:** Added the \`full-ci\` label to this PR. All future commits will run the full CI suite (including minimum dependency tests) until the label is removed.
238242
239243
To disable full CI mode, use the \`/stop-run-skipped-ci\` command.
240244
241-
View progress in the [Actions tab](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions).` : ''}
242-
243-
${labelAdded && notApplicable.length > 0 ? `\nAll CI checks are already running on this PR. Added the \`full-ci\` label - future commits will run the full CI suite.` : ''}`;
245+
View progress in the [Actions tab](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions).` : ''}`;
244246
245247
// Post the comment
246248
await github.rest.issues.createComment({

0 commit comments

Comments
 (0)