|
25 | 25 | - '.github/workflows/**.yml' |
26 | 26 | workflow_dispatch: |
27 | 27 |
|
| 28 | +# Cancels all previous workflow runs for pull requests that have not completed. |
| 29 | +concurrency: |
| 30 | + # The concurrency group contains the workflow name and the branch name for pull requests |
| 31 | + # or the commit hash for any other events. |
| 32 | + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} |
| 33 | + cancel-in-progress: true |
| 34 | + |
28 | 35 | env: |
29 | 36 | PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }} |
30 | 37 |
|
31 | 38 | jobs: |
32 | | - # Prepares the workflow. |
33 | | - # |
34 | | - # Performs the following steps: |
35 | | - # - Cancels all previous workflow runs for pull requests that have not completed. |
36 | | - prepare-workflow: |
37 | | - name: Prepare the workflow |
38 | | - runs-on: ubuntu-latest |
39 | | - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} |
40 | | - |
41 | | - steps: |
42 | | - - name: Cancel previous runs of this workflow (pull requests only) |
43 | | - if: ${{ github.event_name == 'pull_request' }} |
44 | | - uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # v0.8.0 |
45 | | - |
46 | 39 | # Verifies that installing NPM dependencies and building WordPress works as expected. |
47 | 40 | # |
48 | 41 | # Performs the following steps: |
|
59 | 52 | name: Test NPM on ${{ matrix.os }} |
60 | 53 | runs-on: ${{ matrix.os }} |
61 | 54 | if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} |
62 | | - needs: prepare-workflow |
63 | 55 | strategy: |
64 | 56 | fail-fast: false |
65 | 57 | matrix: |
@@ -134,7 +126,6 @@ jobs: |
134 | 126 | name: Test NPM on MacOS |
135 | 127 | runs-on: macos-latest |
136 | 128 | if: ${{ github.repository == 'WordPress/wordpress-develop' }} |
137 | | - needs: prepare-workflow |
138 | 129 | steps: |
139 | 130 | - name: Checkout repository |
140 | 131 | uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 |
|
0 commit comments