|
41 | 41 | FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" |
42 | 42 |
|
43 | 43 | jobs: |
| 44 | + # Scope gate: detect docs-only changes early on a GitHub-hosted runner so |
| 45 | + # Markdown-only PRs avoid Blacksmith-backed CI queues. |
| 46 | + ci_scope: |
| 47 | + name: CI scope gate |
| 48 | + permissions: |
| 49 | + contents: read |
| 50 | + if: github.event_name != 'pull_request' || !github.event.pull_request.draft |
| 51 | + runs-on: ubuntu-24.04 |
| 52 | + timeout-minutes: 10 |
| 53 | + outputs: |
| 54 | + docs_only: ${{ steps.scope.outputs.docs_only }} |
| 55 | + docs_changed: ${{ steps.scope.outputs.docs_changed }} |
| 56 | + steps: |
| 57 | + - name: Checkout |
| 58 | + if: github.event_name != 'workflow_dispatch' |
| 59 | + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 |
| 60 | + with: |
| 61 | + fetch-depth: 0 |
| 62 | + |
| 63 | + - name: Detect docs-only changes |
| 64 | + id: docs_scope |
| 65 | + if: github.event_name != 'workflow_dispatch' |
| 66 | + uses: ./.github/actions/detect-docs-changes |
| 67 | + |
| 68 | + - name: Publish scope outputs |
| 69 | + id: scope |
| 70 | + env: |
| 71 | + DOCS_ONLY: ${{ github.event_name == 'workflow_dispatch' && 'false' || steps.docs_scope.outputs.docs_only || 'false' }} |
| 72 | + DOCS_CHANGED: ${{ github.event_name == 'workflow_dispatch' && 'true' || steps.docs_scope.outputs.docs_changed || 'false' }} |
| 73 | + run: | |
| 74 | + echo "docs_only=${DOCS_ONLY}" >> "$GITHUB_OUTPUT" |
| 75 | + echo "docs_changed=${DOCS_CHANGED}" >> "$GITHUB_OUTPUT" |
| 76 | +
|
44 | 77 | # Preflight: establish routing truth and job matrices once, then let real |
45 | 78 | # work fan out from a single source of truth. |
46 | 79 | preflight: |
47 | 80 | permissions: |
48 | 81 | contents: read |
| 82 | + needs: [ci_scope] |
49 | 83 | if: github.event_name != 'pull_request' || !github.event.pull_request.draft |
50 | | - runs-on: ${{ github.event_name == 'workflow_dispatch' && 'ubuntu-24.04' || (github.repository == 'openclaw/openclaw' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-24.04') }} |
| 84 | + runs-on: ${{ github.event_name == 'workflow_dispatch' && 'ubuntu-24.04' || (github.event_name == 'pull_request' && needs.ci_scope.outputs.docs_only == 'true' && 'ubuntu-24.04' || (github.repository == 'openclaw/openclaw' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-24.04')) }} |
51 | 85 | timeout-minutes: 20 |
52 | 86 | outputs: |
53 | 87 | checkout_revision: ${{ steps.checkout_ref.outputs.sha }} |
@@ -349,13 +383,14 @@ jobs: |
349 | 383 | } |
350 | 384 | EOF |
351 | 385 |
|
352 | | - # Run dependency-free security checks in parallel with scope detection so the |
353 | | - # main Node jobs do not have to wait for Python/pre-commit setup. |
| 386 | + # Run dependency-free security checks after the lightweight scope gate so |
| 387 | + # Markdown-only PRs do not reserve Blacksmith while still keeping the check. |
354 | 388 | security-fast: |
355 | 389 | permissions: |
356 | 390 | contents: read |
| 391 | + needs: [ci_scope] |
357 | 392 | if: github.event_name != 'pull_request' || !github.event.pull_request.draft |
358 | | - runs-on: ${{ github.event_name == 'workflow_dispatch' && 'ubuntu-24.04' || (github.repository == 'openclaw/openclaw' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-24.04') }} |
| 393 | + runs-on: ${{ github.event_name == 'workflow_dispatch' && 'ubuntu-24.04' || (github.event_name == 'pull_request' && needs.ci_scope.outputs.docs_only == 'true' && 'ubuntu-24.04' || (github.repository == 'openclaw/openclaw' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-24.04')) }} |
359 | 394 | timeout-minutes: 20 |
360 | 395 | env: |
361 | 396 | PRE_COMMIT_HOME: .cache/pre-commit-security-fast |
@@ -497,7 +532,7 @@ jobs: |
497 | 532 | contents: read |
498 | 533 | needs: [preflight] |
499 | 534 | if: needs.preflight.outputs.run_node == 'true' || needs.preflight.outputs.run_check_docs == 'true' |
500 | | - runs-on: ${{ github.event_name == 'workflow_dispatch' && 'ubuntu-24.04' || (github.repository == 'openclaw/openclaw' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-24.04') }} |
| 535 | + runs-on: ${{ github.event_name == 'workflow_dispatch' && 'ubuntu-24.04' || (github.event_name == 'pull_request' && needs.preflight.outputs.docs_only == 'true' && 'ubuntu-24.04' || (github.repository == 'openclaw/openclaw' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-24.04')) }} |
501 | 536 | timeout-minutes: 20 |
502 | 537 | steps: |
503 | 538 | - name: Checkout |
@@ -1592,7 +1627,7 @@ jobs: |
1592 | 1627 | contents: read |
1593 | 1628 | needs: [preflight] |
1594 | 1629 | if: needs.preflight.outputs.run_check_docs == 'true' |
1595 | | - runs-on: ${{ github.event_name == 'workflow_dispatch' && 'ubuntu-24.04' || (github.repository == 'openclaw/openclaw' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-24.04') }} |
| 1630 | + runs-on: ${{ github.event_name == 'workflow_dispatch' && 'ubuntu-24.04' || (github.event_name == 'pull_request' && needs.preflight.outputs.docs_only == 'true' && 'ubuntu-24.04' || (github.repository == 'openclaw/openclaw' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-24.04')) }} |
1596 | 1631 | timeout-minutes: 20 |
1597 | 1632 | steps: |
1598 | 1633 | - name: Checkout |
|
0 commit comments