Skip to content

Commit 6837f4a

Browse files
westonruterswissspidyfelixarntz
authored
Merge pull request #2320 from WordPress/add/plugin-check-workflow
Add Plugin Check workflow and remove local plugin-check dependency Co-authored-by: westonruter <westonruter@git.wordpress.org> Co-authored-by: swissspidy <swissspidy@git.wordpress.org> Co-authored-by: felixarntz <flixos90@git.wordpress.org>
2 parents 1510693 + 9c28ac2 commit 6837f4a

35 files changed

Lines changed: 186 additions & 254 deletions

File tree

.github/workflows/bump-wordpress-tested-up-to.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
matrix: ${{ steps.set-matrix.outputs.plugins }}
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5
19+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2020

2121
- name: Configure plugin matrix
2222
id: set-matrix
@@ -46,7 +46,7 @@ jobs:
4646
plugin: ${{ fromJSON(needs.prepare-matrix.outputs.matrix) }}
4747
steps:
4848
- name: Checkout
49-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5
49+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
5050

5151
- name: Download WordPress.org readme
5252
run: |

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ jobs:
3333
security-events: write
3434
steps:
3535
- name: Checkout
36-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5
36+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3737

3838
- name: Initialize CodeQL
39-
uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4
39+
uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
4040
with:
4141
languages: javascript
4242

4343
- name: Perform CodeQL Analysis
44-
uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4
44+
uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9

.github/workflows/deploy-plugins.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
matrix: ${{ steps.set-matrix.outputs.plugins }}
2727
steps:
2828
- name: Checkout
29-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5
29+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3030

3131
- name: Set matrix
3232
id: set-matrix
@@ -58,10 +58,10 @@ jobs:
5858
plugin: ${{ fromJSON(needs.pre-run.outputs.matrix) }}
5959
steps:
6060
- name: Checkout
61-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5
61+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
6262

6363
- name: Setup Node.js (.nvmrc)
64-
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
64+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
6565
with:
6666
node-version-file: '.nvmrc'
6767
cache: npm
@@ -127,7 +127,7 @@ jobs:
127127

128128
- name: Start deployment
129129
if: steps.check-deployment.outputs.deploy == 'true'
130-
uses: bobheadxi/deployments@648679e8e4915b27893bd7dbc35cb504dc915bc8 # v1
130+
uses: bobheadxi/deployments@648679e8e4915b27893bd7dbc35cb504dc915bc8 # v1.5.0
131131
id: wporg-deployment
132132
with:
133133
step: start
@@ -136,7 +136,7 @@ jobs:
136136

137137
- name: Deploy Plugin - ${{ matrix.plugin }}
138138
if: steps.check-deployment.outputs.deploy == 'true'
139-
uses: 10up/action-wordpress-plugin-deploy@2480306f6f693672726d08b5917ea114cb2825f7 # stable
139+
uses: 10up/action-wordpress-plugin-deploy@54bd289b8525fd23a5c365ec369185f2966529c2 # stable
140140
with:
141141
dry-run: ${{ github.event_name == 'workflow_dispatch' && inputs.dry-run || false }}
142142
env:
@@ -149,7 +149,7 @@ jobs:
149149

150150
- name: Finish deployment
151151
if: ${{ steps.wporg-deployment.outputs.deployment_id && always() }}
152-
uses: bobheadxi/deployments@648679e8e4915b27893bd7dbc35cb504dc915bc8 # v1
152+
uses: bobheadxi/deployments@648679e8e4915b27893bd7dbc35cb504dc915bc8 # v1.5.0
153153
with:
154154
step: finish
155155
token: ${{ secrets.GITHUB_TOKEN }}
@@ -172,7 +172,7 @@ jobs:
172172
steps:
173173
- name: Check artifact existence
174174
id: artifact-existence
175-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
175+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
176176
with:
177177
script: |
178178
const getArtifact = await github.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts{?name}', {
@@ -191,14 +191,14 @@ jobs:
191191
192192
- name: Download artifact
193193
if: steps.artifact-existence.outputs.exists == 'true'
194-
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v5
194+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
195195
with:
196196
name: ${{ matrix.plugin }}
197197
path: ./build/dist
198198

199199
- name: Upload release assets
200200
if: steps.artifact-existence.outputs.exists == 'true'
201-
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2
201+
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
202202
with:
203203
files: |
204204
./build/dist/${{ matrix.plugin }}.zip

.github/workflows/e2e-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ jobs:
3333
timeout-minutes: 20
3434
steps:
3535
- name: Checkout
36-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5
36+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3737

3838
- name: Setup Node.js (.nvmrc)
39-
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
39+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
4040
with:
4141
node-version-file: '.nvmrc'
4242
cache: npm

.github/workflows/js-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ jobs:
3838
timeout-minutes: 20
3939
steps:
4040
- uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
41-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5
41+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4242
- name: Setup Node.js (via .nvmrc)
43-
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
43+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
4444
with:
4545
node-version-file: '.nvmrc'
4646
cache: npm

.github/workflows/php-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
timeout-minutes: 20
3535
steps:
3636
- uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
37-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5
38-
- uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2
37+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
38+
- uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
3939
with:
4040
php-version: latest
4141
- name: Get Composer Cache Directory

.github/workflows/php-test-plugins.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ jobs:
6060
WP_ENV_CORE: ${{ matrix.wp == 'trunk' && 'WordPress/WordPress' || format( 'https://wordpress.org/wordpress-{0}.zip', matrix.wp ) }}
6161
steps:
6262
- uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
63-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5
63+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
6464
- name: Setup Node.js (.nvmrc)
65-
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
65+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
6666
with:
6767
node-version-file: '.nvmrc'
6868
cache: npm

.github/workflows/plugin-check.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Plugin Check
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- develop
8+
- trunk
9+
pull_request:
10+
types:
11+
- opened
12+
- synchronize
13+
- ready_for_review
14+
15+
# Cancels all previous workflow runs for pull requests that have not completed.
16+
concurrency:
17+
# The concurrency group contains the workflow name and the branch name for pull requests
18+
# or the commit hash for any other events.
19+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
20+
cancel-in-progress: true
21+
22+
# Disable permissions for all available scopes by default.
23+
# Any needed permissions should be configured at the job level.
24+
permissions: {}
25+
26+
jobs:
27+
prepare-matrix:
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: read
31+
outputs:
32+
plugins: ${{ steps.set-matrix.outputs.plugins }}
33+
steps:
34+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
35+
36+
- uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # 2.36.0
37+
with:
38+
php-version: '8.3'
39+
40+
- name: Setup Node.js (.nvmrc)
41+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
42+
with:
43+
node-version-file: '.nvmrc'
44+
cache: npm
45+
46+
- name: npm install
47+
run: npm ci
48+
49+
- name: Build plugins
50+
run: npm run build-plugins
51+
52+
- name: Upload built plugins
53+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
54+
with:
55+
name: built-plugins
56+
path: build/
57+
retention-days: 1
58+
59+
- name: Generate matrix
60+
id: set-matrix
61+
run: |
62+
PLUGINS=$(jq -c '.plugins' plugins.json)
63+
echo "plugins=$PLUGINS" >> $GITHUB_OUTPUT
64+
65+
plugin-check:
66+
needs: prepare-matrix
67+
name: Check ${{ matrix.plugin }}
68+
runs-on: ubuntu-24.04
69+
permissions:
70+
contents: read
71+
timeout-minutes: 20
72+
strategy:
73+
fail-fast: false
74+
matrix:
75+
plugin: ${{ fromJson(needs.prepare-matrix.outputs.plugins) }}
76+
steps:
77+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
78+
79+
- name: Download built plugins
80+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
81+
with:
82+
name: built-plugins
83+
path: build
84+
85+
- name: Run plugin check
86+
uses: wordpress/plugin-check-action@27b60e89aad9f3006d5c800a8fa9bbaa87c36421 # main
87+
with:
88+
build-dir: ./build/${{ matrix.plugin }}
89+
slug: ${{ matrix.plugin }}
90+
ignore-codes: 'readme_reserved_contributors,WordPress.WP.I18n.TextDomainMismatch'

.github/workflows/props-bot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
uses: WordPress/props-bot-action@80e849eb48a10e9df2ecce3ed8441d9d531d089c # trunk
7575

7676
- name: Remove the props-bot label
77-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
77+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
7878
if: ${{ github.event.action == 'labeled' && 'props-bot' == github.event.label.name }}
7979
with:
8080
retries: 2

.github/workflows/spell-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
name: Spell Check with Typos
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5
10+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1111
- name: Search for misspellings
12-
uses: crate-ci/typos@2d0ce569feab1f8752f1dde43cc2f2aa53236e06 # master
12+
uses: crate-ci/typos@5c19779cb52ea50e151f5a10333ccd269227b5ae # v1.41.0
1313
with:
1414
config: ./.github/typos.toml

0 commit comments

Comments
 (0)