Skip to content

Commit 9391427

Browse files
nickvergessenjuliusknorr
authored andcommitted
ci(actions): Fix custom workflows
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent 51ac9a4 commit 9391427

6 files changed

Lines changed: 45 additions & 54 deletions

File tree

.github/workflows/autoloader.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ jobs:
2121
name: autoloader
2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
24+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
25+
with:
26+
persist-credentials: false
2527

2628
- name: Set up php
27-
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
29+
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2.36.0
2830
with:
2931
php-version: 8.3
3032
tools: composer

.github/workflows/cypress-e2e.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ name: Cypress
55

66
on: pull_request
77

8+
permissions:
9+
contents: read
10+
811
concurrency:
912
group: cypress-${{ github.head_ref || github.run_id }}
1013
cancel-in-progress: ${{ !github.head_ref }}
@@ -27,33 +30,37 @@ jobs:
2730

2831
steps:
2932
- name: Checkout server
30-
uses: actions/checkout@v4.1.1
33+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
3134
with:
35+
persist-credentials: false
3236
repository: nextcloud/server
3337
ref: ${{ matrix.server-versions }}
3438
submodules: true
3539

3640
- name: Checkout viewer
37-
uses: actions/checkout@v4.1.1
41+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
3842
with:
43+
persist-credentials: false
3944
repository: nextcloud/viewer
4045
ref: ${{ matrix.server-versions }}
4146
path: apps/viewer
4247

4348
- name: Checkout assistant
44-
uses: actions/checkout@v4.1.1
49+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
4550
with:
51+
persist-credentials: false
4652
repository: nextcloud/assistant
4753
ref: main
4854
path: apps/assistant
4955

5056
- name: Checkout app
51-
uses: actions/checkout@v4.1.1
57+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
5258
with:
59+
persist-credentials: false
5360
path: apps/${{ env.APP_NAME }}
5461

5562
- name: Read package.json node and npm engines version
56-
uses: skjnldsv/read-package-engines-version-actions@v3
63+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
5764
id: versions
5865
with:
5966
fallbackNode: "^20"
@@ -67,7 +74,7 @@ jobs:
6774
node-version: ${{ steps.versions.outputs.nodeVersion }}
6875

6976
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
70-
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
77+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
7178

7279
- name: Install node dependencies & build app
7380
working-directory: apps/${{ env.APP_NAME }}
@@ -83,7 +90,7 @@ jobs:
8390
npm run build
8491
8592
- name: Save context
86-
uses: buildjet/cache/save@v4.0.2
93+
uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
8794
with:
8895
key: cypress-context-${{ github.run_id }}
8996
path: |
@@ -104,7 +111,7 @@ jobs:
104111

105112
services:
106113
postgres:
107-
image: ghcr.io/nextcloud/continuous-integration-postgres-14:latest
114+
image: ghcr.io/nextcloud/continuous-integration-postgres-16:latest # zizmor: ignore[unpinned-images]
108115
ports:
109116
- 4444:5432/tcp
110117
env:
@@ -115,24 +122,24 @@ jobs:
115122

116123
steps:
117124
- name: Restore context
118-
uses: buildjet/cache/restore@v4.0.2
125+
uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
119126
with:
120127
fail-on-cache-miss: true
121128
key: cypress-context-${{ github.run_id }}
122129
path: |
123130
./
124131
125132
- name: Set up node ${{ needs.init.outputs.nodeVersion }}
126-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
133+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
127134
with:
128135
cache: 'npm'
129136
node-version: ${{ needs.init.outputs.nodeVersion }}
130137

131138
- name: Set up npm ${{ needs.init.outputs.npmVersion }}
132-
run: npm i -g npm@"${{ needs.init.outputs.npmVersion }}"
139+
run: npm i -g 'npm@${{ needs.init.outputs.npmVersion }}'
133140

134141
- name: Set up php ${{ matrix.php-versions }}
135-
uses: shivammathur/setup-php@8872c784b04a1420e81191df5d64fbd59d3d3033 # 2.30.2
142+
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2.36.0
136143
with:
137144
php-version: ${{ matrix.php-versions }}
138145
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, pgsql, pdo_pgsql
@@ -179,7 +186,7 @@ jobs:
179186

180187

181188
- name: Upload snapshots
182-
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
189+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
183190
if: failure()
184191
with:
185192
name: snapshots_${{ matrix.containers }}
@@ -189,7 +196,7 @@ jobs:
189196
retention-days: 5
190197

191198
- name: Upload NC logs
192-
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
199+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
193200
if: failure()
194201
with:
195202
name: nc_logs_${{ matrix.containers }}.log

.github/workflows/node.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,6 @@ jobs:
8686
npm ci
8787
npm run build --if-present
8888
89-
- name: Check build changes
90-
run: |
91-
bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)"
92-
93-
- name: Show changes on failure
94-
if: failure()
95-
run: |
96-
git status
97-
git --no-pager diff
98-
exit 1 # make it red to grab attention
99-
10089
summary:
10190
permissions:
10291
contents: none

.github/workflows/playwright.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,27 @@
22
# SPDX-License-Identifier: MIT
33

44
name: Playwright Tests
5+
56
on:
67
pull_request:
78
branches: [main]
89

10+
permissions:
11+
contents: read
12+
913
jobs:
1014
test:
1115
timeout-minutes: 60
1216
runs-on: ubuntu-latest
1317
steps:
1418
- name: Checkout app
15-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
19+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
20+
with:
21+
persist-credentials: false
1622

1723
- name: Check composer.json
1824
id: check_composer
19-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2
25+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
2026
with:
2127
files: 'composer.json'
2228

@@ -37,7 +43,7 @@ jobs:
3743
node-version: ${{ steps.versions.outputs.nodeVersion }}
3844

3945
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
40-
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
46+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
4147

4248
- name: Install node dependencies & build app
4349
env:
@@ -52,7 +58,8 @@ jobs:
5258
- name: Run Playwright tests
5359
run: npx playwright test
5460

55-
- uses: actions/upload-artifact@v5
61+
- name: Upload results
62+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
5663
if: always()
5764
with:
5865
name: playwright-report

.github/workflows/relative-ci.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/update-node-dist.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
- stable3*
1313
- stable29
1414

15+
permissions:
16+
contents: read
17+
1518
concurrency:
1619
group: update-node-dist-${{ github.head_ref || github.ref || github.run_id }}
1720

@@ -22,8 +25,9 @@ jobs:
2225

2326
steps:
2427
- name: Checkout
25-
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
28+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
2629
with:
30+
persist-credentials: false
2731
token: ${{ secrets.BOT_GITHUB_TOKEN }}
2832

2933
- name: Read package.json node and npm engines version
@@ -34,7 +38,7 @@ jobs:
3438
fallbackNpm: '^9'
3539

3640
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
37-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
41+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
3842
with:
3943
node-version: ${{ steps.versions.outputs.nodeVersion }}
4044

@@ -75,7 +79,9 @@ jobs:
7579
7680
- name: Add and commit
7781
if: steps.changes.outputs.CHANGED != ''
82+
env:
83+
HEAD_REF: ${{ needs.init.outputs.head_ref }}
7884
run: |
7985
git add --force js/ css/
8086
git commit --signoff -m 'chore(assets): recompile assets'
81-
git push origin ${{ github.head_ref }}
87+
git push origin "$HEAD_REF"

0 commit comments

Comments
 (0)