|
81 | 81 | sha: pr.data.head.sha |
82 | 82 | }; |
83 | 83 |
|
84 | | - - name: Add full-ci label |
85 | | - uses: actions/github-script@v7 |
86 | | - with: |
87 | | - script: | |
88 | | - await github.rest.issues.addLabels({ |
89 | | - owner: context.repo.owner, |
90 | | - repo: context.repo.repo, |
91 | | - issue_number: context.issue.number, |
92 | | - labels: ['full-ci'] |
93 | | - }); |
94 | | - console.log('✅ Added full-ci label to PR'); |
95 | | -
|
96 | 84 | - name: Get skipped checks and trigger workflows |
97 | 85 | id: trigger_workflows |
98 | 86 | uses: actions/github-script@v7 |
@@ -228,19 +216,34 @@ jobs: |
228 | 216 | const notFoundList = notFound.length > 0 ? `\n\n**Triggered but not yet queued (may still start):**\n${notFound.map(w => `- ⏳ ${w.name}`).join('\n')}` : ''; |
229 | 217 | const failedList = failed.length > 0 ? `\n\n**Failed to trigger:**\n${failed.map(f => `- ❌ ${f.workflow}: ${f.error}`).join('\n')}` : ''; |
230 | 218 |
|
| 219 | + // Add full-ci label only if we actually triggered workflows or if checks are already running |
| 220 | + let labelAdded = false; |
| 221 | + try { |
| 222 | + await github.rest.issues.addLabels({ |
| 223 | + owner: context.repo.owner, |
| 224 | + repo: context.repo.repo, |
| 225 | + issue_number: context.issue.number, |
| 226 | + labels: ['full-ci'] |
| 227 | + }); |
| 228 | + labelAdded = true; |
| 229 | + console.log('✅ Added full-ci label to PR'); |
| 230 | + } catch (error) { |
| 231 | + console.error('⚠️ Failed to add label:', error.message); |
| 232 | + } |
| 233 | +
|
231 | 234 | const body = `🚀 **Full CI Mode Enabled** |
232 | 235 |
|
233 | 236 | ${status} |
234 | 237 | ${skippedChecksList} |
235 | 238 | ${verifiedList}${notFoundList}${failedList} |
236 | 239 |
|
237 | | - ${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. |
| 240 | + ${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. |
238 | 241 |
|
239 | 242 | To disable full CI mode, use the \`/stop-run-skipped-ci\` command. |
240 | 243 |
|
241 | 244 | View progress in the [Actions tab](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions).` : ''} |
242 | 245 |
|
243 | | - ${notApplicable.length > 0 ? `\nAll CI checks are already running on this PR. The \`full-ci\` label has been added - future commits will run the full CI suite.` : ''}`; |
| 246 | + ${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.` : ''}`; |
244 | 247 |
|
245 | 248 | // Post the comment |
246 | 249 | await github.rest.issues.createComment({ |
|
0 commit comments