99 build :
1010 name : " Build plugin zip"
1111 runs-on : ubuntu-latest
12+ # Don't run on forks.
1213 if : >
13- github.event_name == 'workflow_dispatch' ||
14+ github.repository_owner == 'Yoast' &&
1415 (
15- github.event_name == 'issue_comment' &&
16- github.event.issue.pull_request &&
17- startsWith(github.event.comment.body, '/build-zip')
16+ github.event_name == 'workflow_dispatch' ||
17+ (
18+ github.event_name == 'issue_comment' &&
19+ github.event.issue.pull_request &&
20+ startsWith(github.event.comment.body, '/build-zip')
21+ )
1822 )
1923
2024 steps :
2125 - name : Check actions access
2226 if : github.event_name == 'issue_comment'
23- uses : actions/github-script@v9
27+ uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
2428 with :
2529 script : |
2630 const { data } = await github.rest.repos.getCollaboratorPermissionLevel({
3438
3539 - name : Add reaction to command
3640 if : github.event_name == 'issue_comment'
37- uses : actions/github-script@v9
41+ uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
3842 with :
3943 script : |
4044 await github.rest.reactions.createForIssueComment({
4751 - name : Get PR head ref
4852 if : github.event_name == 'issue_comment'
4953 id : pr
50- uses : actions/github-script@v9
54+ uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
5155 with :
5256 script : |
5357 const { data: pr } = await github.rest.pulls.get({
@@ -58,18 +62,19 @@ jobs:
5862 core.setOutput('ref', pr.head.ref);
5963
6064 - name : Checkout code
61- uses : actions/checkout@v6
65+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6266 with :
6367 ref : ${{ steps.pr.outputs.ref || '' }}
68+ persist-credentials : false
6469
6570 - name : Install PHP
66- uses : shivammathur/setup-php@v2
71+ uses : shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
6772 with :
6873 php-version : 7.4
6974 coverage : none
7075
7176 - name : Set up Node
72- uses : actions/setup-node@v6
77+ uses : actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
7378 with :
7479 node-version-file : ' ./.nvmrc'
7580
@@ -87,15 +92,15 @@ jobs:
8792 run : mv artifact wordpress-seo
8893
8994 - name : Upload zip
90- uses : actions/upload-artifact@v7
95+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
9196 with :
9297 name : wordpress-seo-${{ steps.timestamp.outputs.value }}
9398 path : wordpress-seo/
9499 retention-days : 1
95100
96101 - name : Post artifact link
97102 if : github.event_name == 'issue_comment'
98- uses : actions/github-script@v9
103+ uses : actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
99104 with :
100105 script : |
101106 await github.rest.issues.createComment({
0 commit comments