|
1 | 1 | name: CI - PR Checks |
2 | 2 |
|
3 | 3 | # Cancel previous runs on the same PR when new commits are pushed |
4 | | -# This prevents multiple CI runs from running simultaneously for the same PR |
| 4 | +# Only group by PR number for legitimate triggers (pull_request, workflow_dispatch, /trigger-e2e-full comments) |
| 5 | +# Regular comments get a unique group (run_id) so they don't cancel in-progress test runs |
| 6 | +# |
| 7 | +# Logic: |
| 8 | +# - Regular comments (not /trigger-e2e-full): unique group prevents cancellation of real tests |
| 9 | +# - Valid triggers: group 'ci-pr-checks-{pr_number}' (can cancel previous runs for same PR) |
| 10 | +# - Fallback chain for ID: pull_request.number -> issue.number -> run_id |
| 11 | +# |
| 12 | +# NOTE: Valid command list (/trigger-e2e-full) must stay in sync with check-full-tests job validation |
5 | 13 | concurrency: |
6 | | - group: ci-pr-checks-${{ github.event.pull_request.number || github.run_id }} |
| 14 | + group: >- |
| 15 | + ${{ |
| 16 | + github.event_name == 'issue_comment' && |
| 17 | + !contains(github.event.comment.body, '/trigger-e2e-full') |
| 18 | + && format('comment-isolated-{0}', github.run_id) |
| 19 | + || format('ci-pr-checks-{0}', |
| 20 | + github.event.pull_request.number |
| 21 | + || github.event.issue.number |
| 22 | + || github.run_id) |
| 23 | + }} |
7 | 24 | cancel-in-progress: true |
8 | 25 |
|
9 | 26 | on: |
@@ -230,11 +247,7 @@ jobs: |
230 | 247 | e2e-tests: |
231 | 248 | runs-on: ubuntu-latest |
232 | 249 | needs: [lint-and-test, check-code-changes, check-full-tests] |
233 | | - if: | |
234 | | - # Always run if explicitly triggered via /trigger-e2e-full or workflow_dispatch |
235 | | - needs.check-full-tests.outputs.run_full == 'true' || |
236 | | - # Otherwise, only run if PR has code changes |
237 | | - needs.check-code-changes.outputs.has_code_changes == 'true' |
| 250 | + if: always() && (needs.check-full-tests.outputs.run_full == 'true' || (needs.check-code-changes.result == 'success' && needs.check-code-changes.outputs.has_code_changes == 'true')) |
238 | 251 | timeout-minutes: 60 |
239 | 252 | permissions: |
240 | 253 | contents: read |
|
0 commit comments