Skip to content

Commit 7b9d482

Browse files
authored
Merge pull request #8715 from nextcloud/backport/8713/stable33
[stable33] chore(github): update workflows
2 parents 3995bdd + e87b840 commit 7b9d482

17 files changed

Lines changed: 75 additions & 56 deletions

.github/workflows/command-compile.yml

Lines changed: 31 additions & 18 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'
@@ -105,9 +105,8 @@ jobs:
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@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.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@2c32e18a76e0726ffe7a573bfff2d42a20885126 # 3.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@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1
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@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1
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/node-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
run: npm run test:coverage --if-present
9494

9595
- name: Collect coverage
96-
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
96+
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
9797
with:
9898
files: ./coverage/lcov.info
9999

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
fallbackNpm: '^11.3'
4949

5050
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
51-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
51+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
5252
with:
5353
node-version: ${{ steps.versions.outputs.nodeVersion }}
5454

@@ -70,7 +70,7 @@ jobs:
7070
if: steps.checkout.outcome == 'success'
7171
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
7272
with:
73-
token: ${{ secrets.COMMAND_BOT_PAT }} # zizmor: ignore[secrets-outside-env]
73+
token: ${{ secrets.COMMAND_BOT_PAT }}
7474
commit-message: 'fix(deps): Fix npm audit'
7575
committer: GitHub <noreply@github.com>
7676
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-mariadb.yml

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

107107
- name: Set up php ${{ matrix.php-versions }}
108-
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
108+
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1
109109
with:
110110
php-version: ${{ matrix.php-versions }}
111111
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation

.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@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 2.37.1
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)