Skip to content

Commit 70dd1df

Browse files
Merge pull request #1725 from nextcloud/ci/noid/actions
ci(actions): Pin action versions and update workflow templates
2 parents 7165c04 + f61e206 commit 70dd1df

15 files changed

+133
-64
lines changed

.github/workflows/appstore-build-publish.yml

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
release:
1313
types: [published]
1414

15+
permissions:
16+
contents: write
17+
1518
jobs:
1619
build_and_publish:
1720
runs-on: ubuntu-latest
@@ -32,13 +35,14 @@ jobs:
3235
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
3336
3437
- name: Checkout
35-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
38+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3639
with:
40+
persist-credentials: false
3741
path: ${{ env.APP_NAME }}
3842

3943
- name: Get app version number
4044
id: app-version
41-
uses: skjnldsv/xpath-action@f5b036e9d973f42c86324833fd00be90665fbf77 # master
45+
uses: skjnldsv/xpath-action@f5b036e9d973f42c86324833fd00be90665fbf77 # v1.0.0
4246
with:
4347
filename: ${{ env.APP_NAME }}/appinfo/info.xml
4448
expression: "//info//version/text()"
@@ -49,7 +53,7 @@ jobs:
4953
5054
- name: Get appinfo data
5155
id: appinfo
52-
uses: skjnldsv/xpath-action@f5b036e9d973f42c86324833fd00be90665fbf77 # master
56+
uses: skjnldsv/xpath-action@f5b036e9d973f42c86324833fd00be90665fbf77 # v1.0.0
5357
with:
5458
filename: ${{ env.APP_NAME }}/appinfo/info.xml
5559
expression: "//info//dependencies//nextcloud/@min-version"
@@ -61,8 +65,8 @@ jobs:
6165
continue-on-error: true
6266
with:
6367
path: ${{ env.APP_NAME }}
64-
fallbackNode: '^20'
65-
fallbackNpm: '^10'
68+
fallbackNode: '^24'
69+
fallbackNpm: '^11.3'
6670

6771
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
6872
# Skip if no package.json
@@ -83,7 +87,7 @@ jobs:
8387
filename: ${{ env.APP_NAME }}/appinfo/info.xml
8488

8589
- name: Set up php ${{ steps.php-versions.outputs.php-min }}
86-
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
90+
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2.36.0
8791
with:
8892
php-version: ${{ steps.php-versions.outputs.php-min }}
8993
coverage: none
@@ -136,22 +140,31 @@ jobs:
136140
cd ${{ env.APP_NAME }}
137141
make appstore
138142
139-
- name: Checkout server ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
140-
continue-on-error: true
141-
id: server-checkout
143+
- name: Check server download link for ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
142144
run: |
143145
NCVERSION='${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}'
144-
wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip
145-
unzip latest-$NCVERSION.zip
146+
DOWNLOAD_URL=$(curl -s "https://updates.nextcloud.com/updater_server/latest?channel=beta&version=$NCVERSION" | jq -r '.downloads.zip[0]')
147+
echo "DOWNLOAD_URL=$DOWNLOAD_URL" >> $GITHUB_ENV
148+
149+
- name: Download server ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
150+
continue-on-error: true
151+
id: server-download
152+
if: ${{ env.DOWNLOAD_URL != 'null' }}
153+
run: |
154+
echo "Downloading release tarball from $DOWNLOAD_URL"
155+
wget $DOWNLOAD_URL -O nextcloud.zip
156+
unzip nextcloud.zip
146157
147158
- name: Checkout server master fallback
148-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
149-
if: ${{ steps.server-checkout.outcome != 'success' }}
159+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
160+
if: ${{ steps.server-download.outcome != 'success' }}
150161
with:
162+
persist-credentials: false
151163
submodules: true
152164
repository: nextcloud/server
153165
path: nextcloud
154166

167+
155168
- name: Sign app
156169
run: |
157170
# Extracting release
@@ -168,7 +181,7 @@ jobs:
168181
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
169182
170183
- name: Attach tarball to github release
171-
uses: svenstaro/upload-release-action@6b7fa9f267e90b50a19fef07b3596790bb941741 # v2
184+
uses: svenstaro/upload-release-action@6b7fa9f267e90b50a19fef07b3596790bb941741 # v2.11.3
172185
id: attach_to_release
173186
with:
174187
repo_token: ${{ secrets.GITHUB_TOKEN }}
@@ -178,7 +191,7 @@ jobs:
178191
overwrite: true
179192

180193
- name: Upload app to Nextcloud appstore
181-
uses: nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1 # v1
194+
uses: nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1 # v1.0.3
182195
with:
183196
app_name: ${{ env.APP_NAME }}
184197
appstore_token: ${{ secrets.APPSTORE_TOKEN }}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ jobs:
2727

2828
steps:
2929
- name: Checkout
30-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
30+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
31+
with:
32+
persist-credentials: false
3133

3234
- uses: webiny/action-conventional-commits@8bc41ff4e7d423d56fa4905f6ff79209a78776c7 # v1.3.0
3335
with:

.github/workflows/dependabot-approve-merge.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55
#
6-
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
6+
# SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors
77
# SPDX-License-Identifier: MIT
88

9-
name: Dependabot
9+
name: Auto approve Dependabot PRs
1010

1111
on:
12-
pull_request_target:
12+
pull_request_target: # zizmor: ignore[dangerous-triggers]
1313
branches:
1414
- main
1515
- master
@@ -24,11 +24,13 @@ concurrency:
2424

2525
jobs:
2626
auto-approve-merge:
27-
if: github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]'
27+
if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'renovate[bot]'
2828
runs-on: ubuntu-latest-low
2929
permissions:
3030
# for hmarr/auto-approve-action to approve PRs
3131
pull-requests: write
32+
# for alexwilson/enable-github-automerge-action to approve PRs
33+
contents: write
3234

3335
steps:
3436
- name: Disabled on forks
@@ -37,13 +39,20 @@ jobs:
3739
echo 'Can not approve PRs from forks'
3840
exit 1
3941
42+
- uses: mdecoleman/pr-branch-name@55795d86b4566d300d237883103f052125cc7508 # v3.0.0
43+
id: branchname
44+
with:
45+
repo-token: ${{ secrets.GITHUB_TOKEN }}
46+
4047
# GitHub actions bot approve
41-
- uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
48+
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
49+
if: startsWith(steps.branchname.outputs.branch, 'dependabot/')
4250
with:
4351
github-token: ${{ secrets.GITHUB_TOKEN }}
4452

45-
# Nextcloud bot approve and merge request
46-
- uses: ahmadnassri/action-dependabot-auto-merge@45fc124d949b19b6b8bf6645b6c9d55f4f9ac61a # v2
53+
# Enable GitHub auto merge
54+
- name: Auto merge
55+
uses: alexwilson/enable-github-automerge-action@56e3117d1ae1540309dc8f7a9f2825bc3c5f06ff # v2.0.0
56+
if: startsWith(steps.branchname.outputs.branch, 'dependabot/')
4757
with:
48-
target: minor
49-
github-token: ${{ secrets.DEPENDABOT_AUTOMERGE_TOKEN }}
58+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint-eslint.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,16 @@ jobs:
5656

5757
steps:
5858
- name: Checkout
59-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
59+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
60+
with:
61+
persist-credentials: false
6062

6163
- name: Read package.json node and npm engines version
6264
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
6365
id: versions
6466
with:
65-
fallbackNode: '^20'
66-
fallbackNpm: '^10'
67+
fallbackNode: '^24'
68+
fallbackNpm: '^11.3'
6769

6870
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
6971
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0

.github/workflows/lint-info-xml.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ jobs:
2424
name: info.xml lint
2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
with:
29+
persist-credentials: false
2830

2931
- name: Download schema
3032
run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,18 @@ jobs:
2525

2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
with:
30+
persist-credentials: false
2931

3032
- name: Get php version
3133
id: versions
3234
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
3335

34-
- name: Set up php${{ steps.versions.outputs.php-available }}
35-
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
36+
- name: Set up php${{ steps.versions.outputs.php-min }}
37+
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2.36.0
3638
with:
37-
php-version: ${{ steps.versions.outputs.php-available }}
39+
php-version: ${{ steps.versions.outputs.php-min }}
3840
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
3941
coverage: none
4042
ini-file: development
@@ -43,7 +45,7 @@ jobs:
4345

4446
- name: Install dependencies
4547
run: |
46-
composer remove nextcloud/ocp --dev
48+
composer remove nextcloud/ocp --dev --no-scripts
4749
composer i
4850
4951
- name: Lint

.github/workflows/lint-php.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ jobs:
2424
php-versions: ${{ steps.versions.outputs.php-versions }}
2525
steps:
2626
- name: Checkout app
27-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
with:
29+
persist-credentials: false
30+
2831
- name: Get version matrix
2932
id: versions
3033
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.0.0
@@ -40,10 +43,12 @@ jobs:
4043

4144
steps:
4245
- name: Checkout
43-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
46+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
47+
with:
48+
persist-credentials: false
4449

4550
- name: Set up php ${{ matrix.php-versions }}
46-
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
51+
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2.36.0
4752
with:
4853
php-version: ${{ matrix.php-versions }}
4954
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: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,16 @@ jobs:
2525

2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
with:
30+
persist-credentials: false
2931

3032
- name: Read package.json node and npm engines version
3133
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
3234
id: versions
3335
with:
34-
fallbackNode: '^20'
35-
fallbackNpm: '^10'
36+
fallbackNode: '^24'
37+
fallbackNpm: '^11.3'
3638

3739
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
3840
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0

.github/workflows/node.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ jobs:
5353
name: NPM build
5454
steps:
5555
- name: Checkout
56-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
56+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5757
with:
5858
persist-credentials: false
5959

6060
- name: Read package.json node and npm engines version
6161
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
6262
id: versions
6363
with:
64-
fallbackNode: '^20'
65-
fallbackNpm: '^10'
64+
fallbackNode: '^24'
65+
fallbackNpm: '^11.3'
6666

6767
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
6868
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
@@ -80,7 +80,7 @@ jobs:
8080
npm ci
8181
npm run build --if-present
8282
83-
- name: Check webpack build changes
83+
- name: Check build changes
8484
run: |
8585
bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)"
8686

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
branches: ['main', 'master', 'stable31', 'stable30', 'stable29']
27+
branches:
28+
- ${{ github.event.repository.default_branch }}
29+
- 'stable33'
30+
- 'stable32'
31+
- 'stable31'
2832

2933
name: npm-audit-fix-${{ matrix.branches }}
3034

3135
steps:
3236
- name: Checkout
3337
id: checkout
34-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
38+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3539
with:
3640
persist-credentials: false
3741
ref: ${{ matrix.branches }}
@@ -41,8 +45,8 @@ jobs:
4145
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
4246
id: versions
4347
with:
44-
fallbackNode: '^20'
45-
fallbackNpm: '^10'
48+
fallbackNode: '^24'
49+
fallbackNpm: '^11.3'
4650

4751
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
4852
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0

0 commit comments

Comments
 (0)