Skip to content

Commit 27d755f

Browse files
ci(actions): Update workflow templates from organization template repository
Signed-off-by: GitHub <noreply@github.com>
1 parent fb822f5 commit 27d755f

16 files changed

Lines changed: 155 additions & 96 deletions

.github/actions-lock.txt

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
22
# SPDX-License-Identifier: MIT
3-
3db54dfe0671bf6c30556a5bb6487c22 block-merge-freeze.yml
4-
30c9fe81a0a80bcf36cc7d441fcb8f9d block-unconventional-commits.yml
5-
0c3e9b2e56e1b2590a005a80b55c3218 command-compile.yml
6-
4cb6e4935d3f2bc1e3c99c77739118ca cypress.yml
7-
cbffe424c47647a2e375f96f25b67af9 dependabot-approve-merge.yml
3+
25fc4c7e69e778e20bdc9eb0cc96367e block-merge-freeze.yml
4+
19ab9c47c8d96de93f37fab242c398cc block-unconventional-commits.yml
5+
7f15fef2fde87aae0eb8386ded489372 command-compile.yml
6+
2a86107a27736f1eea0a64154fd8e89e cypress.yml
7+
e6351c608939c31ae1e32923aa82aa10 dependabot-approve-merge.yml
88
2581a67c5bcdcd570427e6d51db767d7 fixup.yml
9-
54f293d9abe11ac0035a7bbb96a4e453 lint-eslint.yml
10-
ccd8a55c60e35b84becb0f7005ce1286 lint-php-cs.yml
11-
5dcc3187a9460cb62a455235cbdb3562 lint-php.yml
12-
cf229fbf443d2f7a303f22eb92745811 lint-stylelint.yml
9+
985f3ac7d51405c1601c742832a14120 lint-eslint.yml
10+
4b40dd0073e16f74dd04e6d49dcc043d lint-php-cs.yml
11+
cfb31e47b6e9ab65e76c89b028754a4e lint-php.yml
12+
ab3a506506b1d7c1cea9593ecfd84366 lint-stylelint.yml
1313
c965845a0def7b39d872e47e93dd1139 node.yml
14-
2d1e4038ee445a9fc1dcdb10c8036d34 npm-audit-fix.yml
15-
3c4a096b3b7dbaef0f8e5190ffe13518 pr-feedback.yml
16-
2070d9569f327e758b9ce2b924c28fef psalm.yml
17-
7db5b820f3750eebe988005a0bb2febd reuse.yml
18-
48c2c657b87747c9faeb589bcce08923 update-stable-titles.yml
14+
aff9f466debc652013b43d1a11b32a0b npm-audit-fix.yml
15+
d1821b8a816578070ed8fd018f321f6d pr-feedback.yml
16+
6dc046dfbca5dc65d938265c518fcac4 psalm.yml
17+
2dbec18233063b42f4d8e03bbb43671c reuse.yml
18+
22604c31b526de270a080eb19967a638 update-stable-titles.yml
19+
28dcf55e283b85c292fea0d0b2a15a8a npm-build.yml

.github/workflows/block-merge-freeze.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
steps:
3131
- name: Register server reference to fallback to master branch
32-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
32+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
3333
with:
3434
github-token: ${{secrets.GITHUB_TOKEN}}
3535
script: |

.github/workflows/block-unconventional-commits.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727

2828
steps:
2929
- name: Checkout
30-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
30+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3131
with:
3232
persist-credentials: false
3333

34-
- uses: webiny/action-conventional-commits@faccb24fc2550dd15c0390d944379d2d8ed9690e # v1.3.1
34+
- uses: webiny/action-conventional-commits@7f91b1595ca1951cdb671ddc9f07a49081ec5b69 # v1.4.2
3535
with:
3636
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/command-compile.yml

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
steps:
3232
- name: Get repository from pull request comment
33-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
33+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
3434
id: get-repository
3535
with:
3636
github-token: ${{secrets.GITHUB_TOKEN}}
@@ -52,20 +52,20 @@ jobs:
5252
exit 1
5353
5454
- name: Check actor permission
55-
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v2
55+
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0
5656
with:
5757
require: write
5858

5959
- name: Add reaction on start
6060
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
6161
with:
62-
token: ${{ secrets.COMMAND_BOT_PAT }} # zizmor: ignore[secrets-outside-env]
62+
token: ${{ secrets.COMMAND_BOT_PAT }}
6363
repository: ${{ github.event.repository.full_name }}
6464
comment-id: ${{ github.event.comment.id }}
6565
reactions: '+1'
6666

6767
- name: Parse command
68-
uses: skjnldsv/parse-command-comment@5c955203c52424151e6d0e58fb9de8a9f6a605a1 # v2
68+
uses: skjnldsv/parse-command-comment@5c955203c52424151e6d0e58fb9de8a9f6a605a1 # v3.1
6969
id: command
7070

7171
# Init path depending on which command is run
@@ -86,7 +86,7 @@ jobs:
8686
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
8787
if: failure()
8888
with:
89-
token: ${{ secrets.COMMAND_BOT_PAT }} # zizmor: ignore[secrets-outside-env]
89+
token: ${{ secrets.COMMAND_BOT_PAT }}
9090
repository: ${{ github.event.repository.full_name }}
9191
comment-id: ${{ github.event.comment.id }}
9292
reactions: '-1'
@@ -97,17 +97,16 @@ jobs:
9797

9898
steps:
9999
- name: Restore cached git repository
100-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
100+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
101101
with:
102102
path: .git
103103
key: git-repo
104104

105105
- name: Checkout ${{ needs.init.outputs.head_ref }}
106-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
106+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
107107
with:
108-
# Needed to allow force push later
109-
persist-credentials: true
110-
token: ${{ secrets.COMMAND_BOT_PAT }} # zizmor: ignore[secrets-outside-env]
108+
persist-credentials: false
109+
token: ${{ secrets.COMMAND_BOT_PAT }}
111110
fetch-depth: 0
112111
ref: ${{ needs.init.outputs.head_ref }}
113112

@@ -124,7 +123,7 @@ jobs:
124123
fallbackNpm: '^11.3'
125124

126125
- name: Set up node ${{ steps.package-engines-versions.outputs.nodeVersion }}
127-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
126+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
128127
with:
129128
node-version: ${{ steps.package-engines-versions.outputs.nodeVersion }}
130129
cache: npm
@@ -134,23 +133,25 @@ jobs:
134133

135134
- name: Rebase to ${{ needs.init.outputs.base_ref }}
136135
if: ${{ contains(needs.init.outputs.arg1, 'rebase') }}
136+
env:
137+
BASE_REF: ${{ needs.init.outputs.base_ref }}
137138
run: |
138-
git fetch origin '${{ needs.init.outputs.base_ref }}:${{ needs.init.outputs.base_ref }}'
139+
git fetch origin "${BASE_REF}:${BASE_REF}"
139140
140141
# Start the rebase
141-
git rebase 'origin/${{ needs.init.outputs.base_ref }}' || {
142+
git rebase "origin/${BASE_REF}" || {
142143
# Handle rebase conflicts in a loop
143144
while [ -d .git/rebase-merge ] || [ -d .git/rebase-apply ]; do
144145
echo "Handling rebase conflict..."
145146
146147
# Remove and checkout /dist and /js folders from the base branch
147148
if [ -d "dist" ]; then
148149
rm -rf dist
149-
git checkout origin/${{ needs.init.outputs.base_ref }} -- dist/ 2>/dev/null || echo "No dist folder in base branch"
150+
git checkout "origin/${BASE_REF}" -- dist/ 2>/dev/null || echo "No dist folder in base branch"
150151
fi
151152
if [ -d "js" ]; then
152153
rm -rf js
153-
git checkout origin/${{ needs.init.outputs.base_ref }} -- js/ 2>/dev/null || echo "No js folder in base branch"
154+
git checkout "origin/${BASE_REF}" -- js/ 2>/dev/null || echo "No js folder in base branch"
154155
fi
155156
156157
# Stage all changes
@@ -182,20 +183,26 @@ jobs:
182183
183184
- name: Commit default
184185
if: ${{ !contains(needs.init.outputs.arg1, 'fixup') && !contains(needs.init.outputs.arg1, 'amend') }}
186+
env:
187+
GIT_PATH: ${{ needs.init.outputs.git_path }}
185188
run: |
186-
git add '${{ github.workspace }}${{ needs.init.outputs.git_path }}'
189+
git add "${GITHUB_WORKSPACE}${GIT_PATH}"
187190
git commit --signoff -m 'chore(assets): Recompile assets'
188191
189192
- name: Commit fixup
190193
if: ${{ contains(needs.init.outputs.arg1, 'fixup') }}
194+
env:
195+
GIT_PATH: ${{ needs.init.outputs.git_path }}
191196
run: |
192-
git add '${{ github.workspace }}${{ needs.init.outputs.git_path }}'
197+
git add "${GITHUB_WORKSPACE}${GIT_PATH}"
193198
git commit --fixup=HEAD --signoff
194199
195200
- name: Commit amend
196201
if: ${{ contains(needs.init.outputs.arg1, 'amend') }}
202+
env:
203+
GIT_PATH: ${{ needs.init.outputs.git_path }}
197204
run: |
198-
git add '${{ github.workspace }}${{ needs.init.outputs.git_path }}'
205+
git add "${GITHUB_WORKSPACE}${GIT_PATH}"
199206
git commit --amend --no-edit --signoff
200207
# Remove any [skip ci] from the amended commit
201208
git commit --amend -m "$(git log -1 --format='%B' | sed '/\[skip ci\]/d')"
@@ -204,19 +211,25 @@ jobs:
204211
if: ${{ !contains(needs.init.outputs.arg1, 'rebase') && !contains(needs.init.outputs.arg1, 'amend') }}
205212
env:
206213
HEAD_REF: ${{ needs.init.outputs.head_ref }}
207-
run: git push origin "$HEAD_REF"
214+
BOT_TOKEN: ${{ secrets.COMMAND_BOT_PAT }} # zizmor: ignore[secrets-outside-env]
215+
run: |
216+
git remote set-url origin "https://x-access-token:${BOT_TOKEN}@github.com/${{ github.repository }}.git"
217+
git push origin "$HEAD_REF"
208218
209219
- name: Force push
210220
if: ${{ contains(needs.init.outputs.arg1, 'rebase') || contains(needs.init.outputs.arg1, 'amend') }}
211221
env:
212222
HEAD_REF: ${{ needs.init.outputs.head_ref }}
213-
run: git push --force-with-lease origin "$HEAD_REF"
223+
BOT_TOKEN: ${{ secrets.COMMAND_BOT_PAT }} # zizmor: ignore[secrets-outside-env]
224+
run: |
225+
git remote set-url origin "https://x-access-token:${BOT_TOKEN}@github.com/${{ github.repository }}.git"
226+
git push --force-with-lease origin "$HEAD_REF"
214227
215228
- name: Add reaction on failure
216229
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
217230
if: failure()
218231
with:
219-
token: ${{ secrets.COMMAND_BOT_PAT }} # zizmor: ignore[secrets-outside-env]
232+
token: ${{ secrets.COMMAND_BOT_PAT }}
220233
repository: ${{ github.event.repository.full_name }}
221234
comment-id: ${{ github.event.comment.id }}
222235
reactions: '-1'

.github/workflows/cypress.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
exit 1
4747
4848
- name: Checkout app
49-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
49+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
5050
with:
5151
persist-credentials: false
5252

@@ -58,7 +58,9 @@ jobs:
5858

5959
- name: Install composer dependencies
6060
if: steps.check_composer.outputs.files_exists == 'true'
61-
run: composer install --no-dev
61+
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0
62+
with:
63+
composer-options: '--no-dev'
6264

6365
- name: Read package.json node and npm engines version
6466
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
@@ -68,7 +70,7 @@ jobs:
6870
fallbackNpm: '^11.3'
6971

7072
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
71-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
73+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
7274
with:
7375
node-version: ${{ steps.versions.outputs.nodeVersion }}
7476

@@ -81,7 +83,7 @@ jobs:
8183
TESTING=true npm run build --if-present
8284
8385
- name: Save context
84-
uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
86+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
8587
with:
8688
key: cypress-context-${{ github.run_id }}
8789
path: ./
@@ -93,42 +95,39 @@ jobs:
9395
strategy:
9496
fail-fast: false
9597
matrix:
96-
# Please increase the number or runners as your tests suite grows (0 based index for e2e tests)
97-
containers: [0, 1, 2, 3, 4, 5, 6, 7]
98-
# Hack as strategy.job-total includes the component and GitHub does not allow math expressions
99-
# Always align this number with the total of e2e runners (max. index + 1)
100-
total-containers: [8]
98+
# Run multiple copies of the current job in parallel
99+
# Please increase the number or runners as your tests suite grows
100+
containers: ['component', '1', '2', '3']
101101

102102
name: runner ${{ matrix.containers }}
103103

104104
steps:
105105
- name: Restore context
106-
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
106+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
107107
with:
108108
fail-on-cache-miss: true
109109
key: cypress-context-${{ github.run_id }}
110110
path: ./
111111

112112
- name: Set up node ${{ needs.init.outputs.nodeVersion }}
113-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
113+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
114114
with:
115115
node-version: ${{ needs.init.outputs.nodeVersion }}
116116

117117
- name: Set up npm ${{ needs.init.outputs.npmVersion }}
118118
run: npm i -g 'npm@${{ needs.init.outputs.npmVersion }}'
119119

120-
- name: Install cypress
121-
run: ./node_modules/cypress/bin/cypress install
122-
123120
- name: Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }} cypress tests
124-
uses: cypress-io/github-action@783cb3f07983868532cabaedaa1e6c00ff4786a8 # v7.1.9
121+
uses: cypress-io/github-action@fa4a118725a8f001170d49631ea89e5d66fee626 # v7.4.1
125122
with:
126-
# We already installed the dependencies in the init job
127-
install: false
123+
record: ${{ secrets.CYPRESS_RECORD_KEY && true }}
124+
parallel: ${{ secrets.CYPRESS_RECORD_KEY && true }}
128125
# cypress run type
129126
component: ${{ matrix.containers == 'component' }}
130-
# Do not add Cypress record key config as this conflicts with cypress-split
131-
# Cypress again tries to force users to buy their dashboard...
127+
group: ${{ secrets.CYPRESS_RECORD_KEY && env.CYPRESS_GROUP }}
128+
# cypress env
129+
ci-build-id: ${{ secrets.CYPRESS_RECORD_KEY && env.CYPRESS_BUILD_ID }}
130+
tag: ${{ secrets.CYPRESS_RECORD_KEY && github.event_name }}
132131
env:
133132
# Needs to be prefixed with CYPRESS_
134133
CYPRESS_BRANCH: ${{ env.BRANCH }}
@@ -137,11 +136,12 @@ jobs:
137136
# Needed for some specific code workarounds
138137
TESTING: true
139138
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
140-
SPLIT: ${{ matrix.total-containers }}
141-
SPLIT_INDEX: ${{ matrix.containers == 'component' && 0 || matrix.containers }}
139+
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
140+
CYPRESS_BUILD_ID: ${{ github.sha }}-${{ github.run_number }}
141+
CYPRESS_GROUP: Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }}
142142

143143
- name: Upload snapshots
144-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
144+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
145145
if: always()
146146
with:
147147
name: snapshots_${{ matrix.containers }}
@@ -152,7 +152,7 @@ jobs:
152152
run: docker logs nextcloud-cypress-tests-${{ env.APP_NAME }} > nextcloud.log
153153

154154
- name: Upload NC logs
155-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
155+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
156156
if: failure() && matrix.containers != 'component'
157157
with:
158158
name: nc_logs_${{ matrix.containers }}

0 commit comments

Comments
 (0)