Skip to content

Commit cf0ca36

Browse files
authored
Merge pull request #389 from nextcloud/fix/update-workflows
chore: Update workflows from nextcloud/.github
2 parents 6eac7d1 + 6bd74d7 commit cf0ca36

15 files changed

+167
-73
lines changed

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

Lines changed: 23 additions & 7 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,25 @@ jobs:
3235
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
3336
3437
- name: Checkout
35-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
38+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3639
with:
40+
persist-credentials: false
3741
path: ${{ env.APP_NAME }}
3842

43+
- name: Get app version number
44+
id: app-version
45+
uses: skjnldsv/xpath-action@f5b036e9d973f42c86324833fd00be90665fbf77 # v1.0.0
46+
with:
47+
filename: ${{ env.APP_NAME }}/appinfo/info.xml
48+
expression: "//info//version/text()"
49+
50+
- name: Validate app version against tag
51+
run: |
52+
[ "${{ env.APP_VERSION }}" = "v${{ fromJSON(steps.app-version.outputs.result).version }}" ]
53+
3954
- name: Get appinfo data
4055
id: appinfo
41-
uses: skjnldsv/xpath-action@7e6a7c379d0e9abc8acaef43df403ab4fc4f770c # master
56+
uses: skjnldsv/xpath-action@f5b036e9d973f42c86324833fd00be90665fbf77 # v1.0.0
4257
with:
4358
filename: ${{ env.APP_NAME }}/appinfo/info.xml
4459
expression: "//info//dependencies//nextcloud/@min-version"
@@ -56,7 +71,7 @@ jobs:
5671
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
5772
# Skip if no package.json
5873
if: ${{ steps.versions.outputs.nodeVersion }}
59-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
74+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
6075
with:
6176
node-version: ${{ steps.versions.outputs.nodeVersion }}
6277

@@ -72,7 +87,7 @@ jobs:
7287
filename: ${{ env.APP_NAME }}/appinfo/info.xml
7388

7489
- name: Set up php ${{ steps.php-versions.outputs.php-min }}
75-
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
90+
uses: shivammathur/setup-php@20529878ed81ef8e78ddf08b480401e6101a850f # v2.35.3
7691
with:
7792
php-version: ${{ steps.php-versions.outputs.php-min }}
7893
coverage: none
@@ -134,9 +149,10 @@ jobs:
134149
unzip latest-$NCVERSION.zip
135150
136151
- name: Checkout server master fallback
137-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
152+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
138153
if: ${{ steps.server-checkout.outcome != 'success' }}
139154
with:
155+
persist-credentials: false
140156
submodules: true
141157
repository: nextcloud/server
142158
path: nextcloud
@@ -157,7 +173,7 @@ jobs:
157173
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
158174
159175
- name: Attach tarball to github release
160-
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2
176+
uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2.11.2
161177
id: attach_to_release
162178
with:
163179
repo_token: ${{ secrets.GITHUB_TOKEN }}
@@ -167,7 +183,7 @@ jobs:
167183
overwrite: true
168184

169185
- name: Upload app to Nextcloud appstore
170-
uses: nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1 # v1
186+
uses: nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1 # v1.0.3
171187
with:
172188
app_name: ${{ env.APP_NAME }}
173189
appstore_token: ${{ secrets.APPSTORE_TOKEN }}

.github/workflows/cypress.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ env:
2424
# n.b. server will use head_ref, as we want to test the PR branch.
2525
BRANCH: ${{ github.base_ref || github.ref_name }}
2626

27+
28+
permissions:
29+
contents: read
30+
2731
jobs:
2832
init:
29-
runs-on: ubuntu-latest-low
33+
runs-on: ubuntu-latest
3034
outputs:
3135
nodeVersion: ${{ steps.versions.outputs.nodeVersion }}
3236
npmVersion: ${{ steps.versions.outputs.npmVersion }}
@@ -42,7 +46,9 @@ jobs:
4246
exit 1
4347
4448
- name: Checkout app
45-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
49+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
50+
with:
51+
persist-credentials: false
4652

4753
- name: Check composer.json
4854
id: check_composer
@@ -62,7 +68,7 @@ jobs:
6268
fallbackNpm: "^10"
6369

6470
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
65-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
71+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
6672
with:
6773
node-version: ${{ steps.versions.outputs.nodeVersion }}
6874

@@ -75,7 +81,7 @@ jobs:
7581
TESTING=true npm run build --if-present
7682
7783
- name: Save context
78-
uses: buildjet/cache/save@v4
84+
uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
7985
with:
8086
key: cypress-context-${{ github.run_id }}
8187
path: ./
@@ -89,28 +95,28 @@ jobs:
8995
matrix:
9096
# Run multiple copies of the current job in parallel
9197
# Please increase the number or runners as your tests suite grows
92-
containers: [1]
98+
containers: ['1']
9399

94100
name: runner ${{ matrix.containers }}
95101

96102
steps:
97103
- name: Restore context
98-
uses: buildjet/cache/restore@v4
104+
uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
99105
with:
100106
fail-on-cache-miss: true
101107
key: cypress-context-${{ github.run_id }}
102108
path: ./
103109

104110
- name: Set up node ${{ needs.init.outputs.nodeVersion }}
105-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
111+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
106112
with:
107113
node-version: ${{ needs.init.outputs.nodeVersion }}
108114

109115
- name: Set up npm ${{ needs.init.outputs.npmVersion }}
110116
run: npm i -g 'npm@${{ needs.init.outputs.npmVersion }}'
111117

112118
- name: Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }} cypress tests
113-
uses: cypress-io/github-action@0da3c06ed8217b912deea9d8ee69630baed1737e # v6.7.6
119+
uses: cypress-io/github-action@b8ba51a856ba5f4c15cf39007636d4ab04f23e3c # v6.10.2
114120
with:
115121
record: ${{ secrets.CYPRESS_RECORD_KEY && true }}
116122
parallel: ${{ secrets.CYPRESS_RECORD_KEY && true }}
@@ -133,7 +139,7 @@ jobs:
133139
CYPRESS_GROUP: Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }}
134140

135141
- name: Upload snapshots
136-
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
142+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
137143
if: always()
138144
with:
139145
name: snapshots_${{ matrix.containers }}
@@ -144,7 +150,7 @@ jobs:
144150
run: docker logs nextcloud-cypress-tests-${{ env.APP_NAME }} > nextcloud.log
145151

146152
- name: Upload NC logs
147-
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
153+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
148154
if: failure() && matrix.containers != 'component'
149155
with:
150156
name: nc_logs_${{ matrix.containers }}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
name: Dependabot
1010

1111
on:
12-
pull_request_target:
12+
pull_request_target: # zizmor: ignore[dangerous-triggers]
1313
branches:
1414
- main
1515
- master
@@ -24,7 +24,7 @@ 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

.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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
27+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
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: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,28 @@ jobs:
2525

2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
28+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
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@20529878ed81ef8e78ddf08b480401e6101a850f # v2.35.3
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
4143
env:
4244
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4345

4446
- name: Install dependencies
45-
run: composer i
47+
run: |
48+
composer remove nextcloud/ocp --dev --no-scripts
49+
composer i
4650
4751
- name: Lint
4852
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )

.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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
27+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
46+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
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@20529878ed81ef8e78ddf08b480401e6101a850f # v2.35.3
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/phpunit-mysql.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ jobs:
2424
matrix: ${{ steps.versions.outputs.sparse-matrix }}
2525
steps:
2626
- name: Checkout app
27-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
27+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28+
with:
29+
persist-credentials: false
2830

2931
- name: Get version matrix
3032
id: versions
@@ -72,7 +74,7 @@ jobs:
7274

7375
services:
7476
mysql:
75-
image: ghcr.io/nextcloud/continuous-integration-mysql-${{ matrix.mysql-versions }}:latest
77+
image: ghcr.io/nextcloud/continuous-integration-mysql-${{ matrix.mysql-versions }}:latest # zizmor: ignore[unpinned-images]
7678
ports:
7779
- 4444:3306/tcp
7880
env:
@@ -81,30 +83,35 @@ jobs:
8183

8284
steps:
8385
- name: Set app env
86+
if: ${{ env.APP_NAME == '' }}
8487
run: |
8588
# Split and keep last
8689
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
8790
8891
- name: Checkout server
89-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
92+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
9093
with:
94+
persist-credentials: false
9195
submodules: true
9296
repository: nextcloud/server
9397
ref: ${{ matrix.server-versions }}
9498

9599
- name: Checkout app
96-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
100+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
97101
with:
102+
persist-credentials: false
98103
path: apps/${{ env.APP_NAME }}
99104

100105
- name: Set up php ${{ matrix.php-versions }}
101-
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
106+
uses: shivammathur/setup-php@20529878ed81ef8e78ddf08b480401e6101a850f # v2.35.3
102107
with:
103108
php-version: ${{ matrix.php-versions }}
104109
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
105110
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, mysql, pdo_mysql
106111
coverage: none
107112
ini-file: development
113+
# Temporary workaround for missing pcntl_* in PHP 8.3
114+
ini-values: disable_functions=
108115
env:
109116
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110117

@@ -123,7 +130,9 @@ jobs:
123130
# Only run if phpunit config file exists
124131
if: steps.check_composer.outputs.files_exists == 'true'
125132
working-directory: apps/${{ env.APP_NAME }}
126-
run: composer i
133+
run: |
134+
composer remove nextcloud/ocp --dev --no-scripts
135+
composer i
127136
128137
- name: Set up Nextcloud
129138
env:

0 commit comments

Comments
 (0)