Skip to content

Commit e39244f

Browse files
ci(gh): Sync workflow updates
Signed-off-by: Andy Scherzinger <[email protected]>
1 parent 45672ff commit e39244f

36 files changed

+275
-93
lines changed

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

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,22 @@ jobs:
2727

2828
steps:
2929
- name: Set server major version environment
30-
run: |
31-
# retrieve version number from branch reference
32-
server_major=$(echo "${{ github.base_ref }}" | sed -En 's/stable//p')
33-
echo "server_major=$server_major" >> $GITHUB_ENV
34-
echo "current_month=$(date +%Y-%m)" >> $GITHUB_ENV
35-
36-
- name: Checking if ${{ env.server_major }} is EOL
30+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
31+
with:
32+
github-token: ${{secrets.GITHUB_TOKEN}}
33+
script: |
34+
const regex = /^stable(\d+)$/
35+
const baseRef = context.payload.pull_request.base.ref
36+
const match = baseRef.match(regex)
37+
if (match) {
38+
console.log('Setting server_major to ' + match[1]);
39+
core.exportVariable('server_major', match[1]);
40+
console.log('Setting current_month to ' + (new Date()).toISOString().substr(0, 7));
41+
core.exportVariable('current_month', (new Date()).toISOString().substr(0, 7));
42+
}
43+
44+
- name: Checking if server ${{ env.server_major }} is EOL
45+
if: ${{ env.server_major != '' }}
3746
run: |
3847
curl -s https://raw.githubusercontent.com/nextcloud-releases/updater_server/production/config/major_versions.json \
3948
| jq '.["${{ env.server_major }}"]["eol"] // "9999-99" | . >= "${{ env.current_month }}"' \

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

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,30 @@ jobs:
2828
runs-on: ubuntu-latest-low
2929

3030
steps:
31-
- name: Download version.php from ${{ github.base_ref }}
32-
run: curl 'https://raw.githubusercontent.com/nextcloud/server/${{ github.base_ref }}/version.php' --output version.php
31+
- name: Register server reference to fallback to master branch
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+
51+
- name: Download version.php from ${{ env.server_ref }}
52+
if: ${{ env.server_ref != '' }}
53+
run: curl 'https://raw.githubusercontent.com/nextcloud/server/${{ env.server_ref }}/version.php' --output version.php
3354

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

.github/workflows/block-outdated-3rdparty.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,44 @@ jobs:
3232
3333
- name: Checkout
3434
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
35+
with:
36+
persist-credentials: false
3537

3638
- name: 3rdparty commit hash on current branch
3739
id: actual
3840
run: |
3941
echo "commit=$(git submodule status | grep ' 3rdparty' | egrep -o '[a-f0-9]{40}')" >> "$GITHUB_OUTPUT"
4042
43+
- name: Register server reference to fallback to master branch
44+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
45+
with:
46+
github-token: ${{secrets.GITHUB_TOKEN}}
47+
script: |
48+
const baseRef = context.payload.pull_request.base.ref
49+
if (baseRef === 'main' || baseRef === 'master') {
50+
core.exportVariable('server_ref', 'master');
51+
console.log('Setting server_ref to master');
52+
} else {
53+
const regex = /^stable(\d+)$/
54+
const match = baseRef.match(regex)
55+
if (match) {
56+
core.exportVariable('server_ref', match[0]);
57+
console.log('Setting server_ref to ' + match[0]);
58+
} else {
59+
console.log('Not based on master/main/stable*, so skipping freeze check');
60+
}
61+
}
62+
4163
- name: Last 3rdparty commit on target branch
4264
id: target
4365
run: |
44-
echo "commit=$(git ls-remote https://github.com/nextcloud/3rdparty refs/heads/${{ github.base_ref }} | awk '{ print $1}')" >> "$GITHUB_OUTPUT"
66+
echo "commit=$(git ls-remote https://github.com/nextcloud/3rdparty refs/heads/${{ env.server_ref }} | awk '{ print $1}')" >> "$GITHUB_OUTPUT"
4567
4668
- name: Compare if 3rdparty commits are different
4769
run: |
4870
echo '3rdparty/ seems to not point to the last commit of the dedicated branch:'
4971
echo 'Branch has: ${{ steps.actual.outputs.commit }}'
50-
echo '${{ github.base_ref }} has: ${{ steps.target.outputs.commit }}'
72+
echo '${{ env.server_ref }} has: ${{ steps.target.outputs.commit }}'
5173
5274
- name: Fail if 3rdparty commits are different
5375
if: ${{ steps.changes.outputs.src != 'false' && steps.actual.outputs.commit != steps.target.outputs.commit }}

.github/workflows/command-pull-3rdparty.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,56 @@ jobs:
3838
id: comment-branch
3939

4040
- name: Checkout ${{ steps.comment-branch.outputs.head_ref }}
41-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
41+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4242
with:
43+
persist-credentials: false
4344
fetch-depth: 0
4445
token: ${{ secrets.COMMAND_BOT_PAT }}
4546
ref: ${{ steps.comment-branch.outputs.head_ref }}
4647

48+
- name: Register server reference to fallback to master branch
49+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
50+
with:
51+
github-token: ${{secrets.GITHUB_TOKEN}}
52+
script: |
53+
const baseRef = context.payload.pull_request.base.ref
54+
if (baseRef === 'main' || baseRef === 'master') {
55+
core.exportVariable('server_ref', 'master');
56+
console.log('Setting server_ref to master');
57+
} else {
58+
const regex = /^stable(\d+)$/
59+
const match = baseRef.match(regex)
60+
if (match) {
61+
core.exportVariable('server_ref', match[0]);
62+
console.log('Setting server_ref to ' + match[0]);
63+
} else {
64+
console.log('Not based on master/main/stable*, so skipping freeze check');
65+
}
66+
}
67+
4768
- name: Setup git
4869
run: |
4970
git config --local user.email '[email protected]'
5071
git config --local user.name 'nextcloud-command'
5172
73+
- name: Add reaction on failure
74+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v3.0.1
75+
if: ${{ env.server_ref == '' }}
76+
with:
77+
token: ${{ secrets.COMMAND_BOT_PAT }}
78+
repository: ${{ github.event.repository.full_name }}
79+
comment-id: ${{ github.event.comment.id }}
80+
reactions: '-1'
81+
5282
- name: Pull 3rdparty
53-
run: git submodule foreach 'if [ "$sm_path" == "3rdparty" ]; then git pull origin '"'"'${{ github.event.issue.pull_request.base.ref }}'"'"'; fi'
83+
if: ${{ env.server_ref != '' }}
84+
run: git submodule foreach 'if [ "$sm_path" == "3rdparty" ]; then git pull origin '"'"'${{ env.server_ref }}'"'"'; fi'
5485

5586
- name: Commit and push changes
87+
if: ${{ env.server_ref != '' }}
5688
run: |
5789
git add 3rdparty
58-
git commit -s -m 'Update submodule 3rdparty to latest ${{ github.event.issue.pull_request.base.ref }}'
90+
git commit -s -m 'Update submodule 3rdparty to latest ${{ env.server_ref }}'
5991
git push
6092
6193
- name: Add reaction on failure

.github/workflows/cypress.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ jobs:
150150
SPLIT: ${{ matrix.total-containers }}
151151
SPLIT_INDEX: ${{ matrix.containers == 'component' && 0 || matrix.containers }}
152152

153-
- name: Upload snapshots
153+
- name: Upload snapshots and videos
154154
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
155155
if: always()
156156
with:

.github/workflows/files-external-ftp.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
schedule:
77
- cron: "5 2 * * *"
88

9+
permissions:
10+
contents: read
11+
912
concurrency:
1013
group: files-external-ftp-${{ github.head_ref || github.run_id }}
1114
cancel-in-progress: true
@@ -53,8 +56,9 @@ jobs:
5356

5457
steps:
5558
- name: Checkout server
56-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
59+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5760
with:
61+
persist-credentials: false
5862
submodules: true
5963

6064
- name: Set up ftpd

.github/workflows/files-external-s3.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
schedule:
77
- cron: "5 2 * * *"
88

9+
permissions:
10+
contents: read
11+
912
concurrency:
1013
group: files-external-s3-${{ github.head_ref || github.run_id }}
1114
cancel-in-progress: true
@@ -50,7 +53,7 @@ jobs:
5053

5154
services:
5255
minio:
53-
image: bitnami/minio
56+
image: bitnami/minio@sha256:50cec18ac4184af4671a78aedd5554942c8ae105d51a465fa82037949046da01 # v2025.4.22
5457
env:
5558
MINIO_ROOT_USER: nextcloud
5659
MINIO_ROOT_PASSWORD: bWluaW8tc2VjcmV0LWtleS1uZXh0Y2xvdWQ=
@@ -60,8 +63,9 @@ jobs:
6063

6164
steps:
6265
- name: Checkout server
63-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
66+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6467
with:
68+
persist-credentials: false
6569
submodules: true
6670

6771
- name: Set up php ${{ matrix.php-versions }}
@@ -129,13 +133,13 @@ jobs:
129133
env:
130134
SERVICES: s3
131135
DEBUG: 1
132-
image: localstack/localstack
136+
image: localstack/localstack@sha256:b52c16663c70b7234f217cb993a339b46686e30a1a5d9279cb5feeb2202f837c # v4.4.0
133137
ports:
134138
- "4566:4566"
135139

136140
steps:
137141
- name: Checkout server
138-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
142+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
139143
with:
140144
submodules: true
141145

.github/workflows/files-external-sftp.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
schedule:
77
- cron: "5 2 * * *"
88

9+
permissions:
10+
contents: read
11+
912
concurrency:
1013
group: files-external-sftp-${{ github.head_ref || github.run_id }}
1114
cancel-in-progress: true
@@ -53,8 +56,9 @@ jobs:
5356

5457
steps:
5558
- name: Checkout server
56-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
59+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5760
with:
61+
persist-credentials: false
5862
submodules: true
5963

6064
- name: Set up sftpd

.github/workflows/files-external-smb-kerberos.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
schedule:
77
- cron: "5 2 * * *"
88

9+
permissions:
10+
contents: read
11+
912
concurrency:
1013
group: files-external-smb-kerberos-${{ github.head_ref || github.run_id }}
1114
cancel-in-progress: true
@@ -43,13 +46,15 @@ jobs:
4346

4447
steps:
4548
- name: Checkout server
46-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
49+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4750
with:
51+
persist-credentials: false
4852
submodules: true
4953

5054
- name: Checkout user_saml
51-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
55+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5256
with:
57+
persist-credentials: false
5358
repository: nextcloud/user_saml
5459
path: apps/user_saml
5560

.github/workflows/files-external-smb.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
schedule:
77
- cron: "5 2 * * *"
88

9+
permissions:
10+
contents: read
11+
912
concurrency:
1013
group: files-external-smb-${{ github.head_ref || github.run_id }}
1114
cancel-in-progress: true
@@ -50,14 +53,15 @@ jobs:
5053

5154
services:
5255
samba:
53-
image: ghcr.io/nextcloud/continuous-integration-samba:latest
56+
image: ghcr.io/nextcloud/continuous-integration-samba:latest # zizmor: ignore[unpinned-images]
5457
ports:
5558
- 445:445
5659

5760
steps:
5861
- name: Checkout server
59-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
62+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6063
with:
64+
persist-credentials: false
6165
submodules: true
6266

6367
- name: Set up php ${{ matrix.php-versions }}

0 commit comments

Comments
 (0)