Skip to content

Commit 9fb32b0

Browse files
committed
chore: update workflows
Signed-off-by: Daniel Kesselberg <[email protected]>
1 parent 0c51d98 commit 9fb32b0

14 files changed

+172
-59
lines changed

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

+21-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,29 @@ jobs:
2929

3030
steps:
3131
- name: Register server reference to fallback to master branch
32-
run: |
33-
server_ref="$(if [ '${{ github.base_ref }}' = 'main' ]; then echo -n 'master'; else echo -n '${{ github.base_ref }}'; fi)"
34-
echo "server_ref=$server_ref" >> $GITHUB_ENV
32+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
33+
with:
34+
github-token: ${{secrets.GITHUB_TOKEN}}
35+
script: |
36+
const baseRef = context.payload.pull_request.base.ref
37+
if (baseRef === 'main' || baseRef === 'master') {
38+
core.exportVariable('server_ref', 'master');
39+
console.log('Setting server_ref to master');
40+
} else {
41+
const regex = /^stable(\d+)$/
42+
const match = baseRef.match(regex)
43+
if (match) {
44+
core.exportVariable('server_ref', match[0]);
45+
console.log('Setting server_ref to ' + match[0]);
46+
} else {
47+
console.log('Not based on master/main/stable*, so skipping freeze check');
48+
}
49+
}
50+
3551
- name: Download version.php from ${{ env.server_ref }}
52+
if: ${{ env.server_ref != '' }}
3653
run: curl 'https://raw.githubusercontent.com/nextcloud/server/${{ env.server_ref }}/version.php' --output version.php
3754

3855
- name: Run check
56+
if: ${{ env.server_ref != '' }}
3957
run: cat version.php | grep 'OC_VersionString' | grep -i -v 'RC'

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

+8-2
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,13 +24,19 @@ 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
3232

3333
steps:
34+
- name: Disabled on forks
35+
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
36+
run: |
37+
echo 'Can not approve PRs from forks'
38+
exit 1
39+
3440
# GitHub actions bot approve
3541
- uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
3642
with:

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

+9-5
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.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@2e947f1f6932d141d076ca441d0e1e881775e95b # v2.31.0
36+
- name: Set up php${{ steps.versions.outputs.php-min }}
37+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
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
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

+8-3
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
46+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
with:
48+
persist-credentials: false
4449

4550
- name: Set up php ${{ matrix.php-versions }}
46-
uses: shivammathur/setup-php@2e947f1f6932d141d076ca441d0e1e881775e95b # v2.31.0
51+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
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-mariadb.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ jobs:
2525
server-max: ${{ steps.versions.outputs.branches-max-list }}
2626
steps:
2727
- name: Checkout app
28-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
with:
30+
persist-credentials: false
2931

3032
- name: Get version matrix
3133
id: versions
@@ -68,7 +70,7 @@ jobs:
6870
matrix:
6971
php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }}
7072
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
71-
mariadb-versions: ['10.6', '10.11']
73+
mariadb-versions: ['10.6', '11.4']
7274

7375
name: MariaDB ${{ matrix.mariadb-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}
7476

@@ -78,35 +80,40 @@ jobs:
7880
ports:
7981
- 4444:3306/tcp
8082
env:
81-
MYSQL_ROOT_PASSWORD: rootpassword
82-
options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 5
83+
MARIADB_ROOT_PASSWORD: rootpassword
84+
options: --health-cmd="mariadb-admin ping" --health-interval 5s --health-timeout 2s --health-retries 5
8385

8486
steps:
8587
- name: Set app env
88+
if: ${{ env.APP_NAME == '' }}
8689
run: |
8790
# Split and keep last
8891
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
8992
9093
- name: Checkout server
91-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
94+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
9295
with:
96+
persist-credentials: false
9397
submodules: true
9498
repository: nextcloud/server
9599
ref: ${{ matrix.server-versions }}
96100

97101
- name: Checkout app
98-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
102+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
99103
with:
104+
persist-credentials: false
100105
path: apps/${{ env.APP_NAME }}
101106

102107
- name: Set up php ${{ matrix.php-versions }}
103-
uses: shivammathur/setup-php@2e947f1f6932d141d076ca441d0e1e881775e95b # v2.31.0
108+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
104109
with:
105110
php-version: ${{ matrix.php-versions }}
106111
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
107112
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, mysql, pdo_mysql
108113
coverage: none
109114
ini-file: development
115+
# Temporary workaround for missing pcntl_* in PHP 8.3
116+
ini-values: disable_functions=
110117
env:
111118
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112119

@@ -125,7 +132,9 @@ jobs:
125132
# Only run if phpunit config file exists
126133
if: steps.check_composer.outputs.files_exists == 'true'
127134
working-directory: apps/${{ env.APP_NAME }}
128-
run: composer i
135+
run: |
136+
composer remove nextcloud/ocp --dev
137+
composer i
129138
130139
- name: Set up Nextcloud
131140
env:

.github/workflows/phpunit-mysql.yml

+14-5
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
with:
29+
persist-credentials: false
2830

2931
- name: Get version matrix
3032
id: versions
@@ -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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
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@2e947f1f6932d141d076ca441d0e1e881775e95b # v2.31.0
106+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
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
135+
composer i
127136
128137
- name: Set up Nextcloud
129138
env:

.github/workflows/phpunit-oci.yml

+14-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ jobs:
2525
server-max: ${{ steps.versions.outputs.branches-max-list }}
2626
steps:
2727
- name: Checkout app
28-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
with:
30+
persist-credentials: false
2931

3032
- name: Get version matrix
3133
id: versions
@@ -94,30 +96,35 @@ jobs:
9496
9597
steps:
9698
- name: Set app env
99+
if: ${{ env.APP_NAME == '' }}
97100
run: |
98101
# Split and keep last
99102
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
100103
101104
- name: Checkout server
102-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
105+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
103106
with:
107+
persist-credentials: false
104108
submodules: true
105109
repository: nextcloud/server
106110
ref: ${{ matrix.server-versions }}
107111

108112
- name: Checkout app
109-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
113+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
110114
with:
115+
persist-credentials: false
111116
path: apps/${{ env.APP_NAME }}
112117

113118
- name: Set up php ${{ matrix.php-versions }}
114-
uses: shivammathur/setup-php@2e947f1f6932d141d076ca441d0e1e881775e95b # v2.31.0
119+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
115120
with:
116121
php-version: ${{ matrix.php-versions }}
117122
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
118123
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, oci8
119124
coverage: none
120125
ini-file: development
126+
# Temporary workaround for missing pcntl_* in PHP 8.3
127+
ini-values: disable_functions=
121128
env:
122129
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123130

@@ -131,7 +138,9 @@ jobs:
131138
# Only run if phpunit config file exists
132139
if: steps.check_composer.outputs.files_exists == 'true'
133140
working-directory: apps/${{ env.APP_NAME }}
134-
run: composer i
141+
run: |
142+
composer remove nextcloud/ocp --dev
143+
composer i
135144
136145
- name: Set up Nextcloud
137146
env:

.github/workflows/phpunit-pgsql.yml

+14-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ jobs:
2525
server-max: ${{ steps.versions.outputs.branches-max-list }}
2626
steps:
2727
- name: Checkout app
28-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
with:
30+
persist-credentials: false
2931

3032
- name: Get version matrix
3133
id: versions
@@ -84,30 +86,35 @@ jobs:
8486

8587
steps:
8688
- name: Set app env
89+
if: ${{ env.APP_NAME == '' }}
8790
run: |
8891
# Split and keep last
8992
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
9093
9194
- name: Checkout server
92-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
95+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
9396
with:
97+
persist-credentials: false
9498
submodules: true
9599
repository: nextcloud/server
96100
ref: ${{ matrix.server-versions }}
97101

98102
- name: Checkout app
99-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
103+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
100104
with:
105+
persist-credentials: false
101106
path: apps/${{ env.APP_NAME }}
102107

103108
- name: Set up php ${{ matrix.php-versions }}
104-
uses: shivammathur/setup-php@2e947f1f6932d141d076ca441d0e1e881775e95b # v2.31.0
109+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
105110
with:
106111
php-version: ${{ matrix.php-versions }}
107112
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
108113
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, pgsql, pdo_pgsql
109114
coverage: none
110115
ini-file: development
116+
# Temporary workaround for missing pcntl_* in PHP 8.3
117+
ini-values: disable_functions=
111118
env:
112119
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113120

@@ -121,7 +128,9 @@ jobs:
121128
# Only run if phpunit config file exists
122129
if: steps.check_composer.outputs.files_exists == 'true'
123130
working-directory: apps/${{ env.APP_NAME }}
124-
run: composer i
131+
run: |
132+
composer remove nextcloud/ocp --dev
133+
composer i
125134
126135
- name: Set up Nextcloud
127136
env:

0 commit comments

Comments
 (0)