Skip to content

Commit f4a9a24

Browse files
authored
Merge pull request #1326 from nextcloud/automated/noid/stable32-update-workflows
[stable32] ci(actions): Update workflow templates from organization template repository
2 parents e884c0d + 7962499 commit f4a9a24

13 files changed

Lines changed: 70 additions & 49 deletions

.github/actions-lock.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
# SPDX-License-Identifier: MIT
33
9f2b534bea27e8ec2dda7c1d772a664b block-merge-eol.yml
44
25fc4c7e69e778e20bdc9eb0cc96367e block-merge-freeze.yml
5-
169b5a5085493975bb375af516b288cc command-compile.yml
6-
7dd8d21d9dd013196cd4bdbf7c24db6f dependabot-approve-merge.yml
5+
a5a8fc40c0f979c2d799ae114a0b840b command-compile.yml
6+
d00c282925ce19918cc26ec0827d9726 dependabot-approve-merge.yml
77
2581a67c5bcdcd570427e6d51db767d7 fixup.yml
8-
54f293d9abe11ac0035a7bbb96a4e453 lint-eslint.yml
9-
ccd8a55c60e35b84becb0f7005ce1286 lint-php-cs.yml
10-
5dcc3187a9460cb62a455235cbdb3562 lint-php.yml
11-
cf229fbf443d2f7a303f22eb92745811 lint-stylelint.yml
12-
c965845a0def7b39d872e47e93dd1139 node.yml
13-
8d41f3688950b42dce423fb9fc1f785c npm-audit-fix.yml
14-
5846b994639ccab0059bf23e141d389a phpunit-mysql.yml
15-
ec7d1084fbb3a6803dbabf3acdd17ac8 phpunit-oci.yml
16-
29b359a5b76e7ff8cd85af34b3bf36e3 phpunit-pgsql.yml
17-
182cc739d33a2441d3a9278a9bff55b4 phpunit-sqlite.yml
8+
7bcfba381bfb7c28d9ef6a7d55ac937b lint-eslint.yml
9+
058024e4560ae1f18f6e4be9ecc0dacb lint-php-cs.yml
10+
d86aa09feb6ce2ad244926aff7adcb36 lint-php.yml
11+
bd5b5245dc07b5779031e13817663a3e lint-stylelint.yml
12+
03759c9dc0fa748cb927b9f9cadf2925 node.yml
13+
20d567b2158851c6b54170e0a7c7fc30 npm-audit-fix.yml
14+
efac00595fcf8c91902a40467bb8e58a phpunit-mysql.yml
15+
ea1ad2b41d5c8730af03c2923fd0d90d phpunit-oci.yml
16+
5f7de35e496afb4f1206fe18017d6320 phpunit-pgsql.yml
17+
10d907363827d671d37831b78c0a1137 phpunit-sqlite.yml
1818
3c4a096b3b7dbaef0f8e5190ffe13518 pr-feedback.yml
1919
7db5b820f3750eebe988005a0bb2febd reuse.yml

.github/workflows/command-compile.yml

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
101101
with:
102102
path: .git
103103
key: git-repo
104104

105105
- name: Checkout ${{ needs.init.outputs.head_ref }}
106106
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
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@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.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/dependabot-approve-merge.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
if: github.event.pull_request.user.login == 'dependabot[bot]'
2828
runs-on: ubuntu-latest-low
2929
permissions:
30-
# for hmarr/auto-approve-action to approve PRs
30+
# for auto-approve step to work
3131
pull-requests: write
3232
# for alexwilson/enable-github-automerge-action to approve PRs
3333
contents: write
@@ -44,15 +44,22 @@ jobs:
4444
with:
4545
repo-token: ${{ secrets.GITHUB_TOKEN }}
4646

47-
# GitHub actions bot approve
48-
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
49-
if: startsWith(steps.branchname.outputs.branch, 'dependabot/')
47+
- name: Dependabot metadata
48+
id: metadata
49+
uses: dependabot/fetch-metadata@ffa630c65fa7e0ecfa0625b5ceda64399aea1b36 # v3.0.0
5050
with:
5151
github-token: ${{ secrets.GITHUB_TOKEN }}
5252

53+
- name: GitHub actions bot approve
54+
if: startsWith(steps.branchname.outputs.branch, 'dependabot/')
55+
run: gh pr review --approve "$PR_URL"
56+
env:
57+
PR_URL: ${{ github.event.pull_request.html_url }}
58+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
5360
# Enable GitHub auto merge
5461
- name: Auto merge
55-
uses: alexwilson/enable-github-automerge-action@56e3117d1ae1540309dc8f7a9f2825bc3c5f06ff # v2.0.0
56-
if: startsWith(steps.branchname.outputs.branch, 'dependabot/') && (github.event.pull_request.action == 'opened' || github.event.pull_request.action == 'reopened')
62+
uses: alexwilson/enable-github-automerge-action@56e3117d1ae1540309dc8f7a9f2825bc3c5f06ff # 2.0.0
63+
if: startsWith(steps.branchname.outputs.branch, 'dependabot/') && (github.event.action == 'opened' || github.event.action == 'reopened') && (steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor')
5764
with:
5865
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint-eslint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
fallbackNpm: '^11.3'
6969

7070
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
71-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
71+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
7272
with:
7373
node-version: ${{ steps.versions.outputs.nodeVersion }}
7474

.github/workflows/lint-php-cs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
uses: icewind1991/nextcloud-version-matrix@8a7bac6300b2f0f3100088b297995a229558ddba # v1.3.2
3535

3636
- name: Set up php${{ steps.versions.outputs.php-min }}
37-
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
37+
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
3838
with:
3939
php-version: ${{ steps.versions.outputs.php-min }}
4040
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite

.github/workflows/lint-php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
persist-credentials: false
5050

5151
- name: Set up php ${{ matrix.php-versions }}
52-
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
52+
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
5353
with:
5454
php-version: ${{ matrix.php-versions }}
5555
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite

.github/workflows/lint-stylelint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
fallbackNpm: '^11.3'
3838

3939
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
40-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
40+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
4141
with:
4242
node-version: ${{ steps.versions.outputs.nodeVersion }}
4343

.github/workflows/npm-audit-fix.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
matrix:
2727
branches:
2828
- ${{ github.event.repository.default_branch }}
29+
- 'stable34'
2930
- 'stable33'
3031
- 'stable32'
3132

@@ -48,7 +49,7 @@ jobs:
4849
fallbackNpm: '^11.3'
4950

5051
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
51-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
52+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
5253
with:
5354
node-version: ${{ steps.versions.outputs.nodeVersion }}
5455

@@ -71,7 +72,7 @@ jobs:
7172
if: steps.checkout.outcome == 'success'
7273
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
7374
with:
74-
token: ${{ secrets.COMMAND_BOT_PAT }} # zizmor: ignore[secrets-outside-env]
75+
token: ${{ secrets.COMMAND_BOT_PAT }}
7576
commit-message: 'fix(deps): Fix npm audit'
7677
committer: GitHub <noreply@github.com>
7778
author: nextcloud-command <nextcloud-command@users.noreply.github.com>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
77
# SPDX-License-Identifier: MIT
88

9-
name: Node
9+
name: Build Javascript
1010

1111
on: pull_request
1212

@@ -65,7 +65,7 @@ jobs:
6565
fallbackNpm: '^11.3'
6666

6767
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
68-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
68+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
6969
with:
7070
node-version: ${{ steps.versions.outputs.nodeVersion }}
7171

.github/workflows/phpunit-mysql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
path: apps/${{ env.APP_NAME }}
104104

105105
- name: Set up php ${{ matrix.php-versions }}
106-
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
106+
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
107107
with:
108108
php-version: ${{ matrix.php-versions }}
109109
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation

0 commit comments

Comments
 (0)