Skip to content

Commit c4da3cc

Browse files
authored
Merge pull request #56625 from nextcloud/chore/workflows
ci: update workflows from organization
2 parents 4f25051 + 930ec23 commit c4da3cc

22 files changed

+237
-151
lines changed

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

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

2828
steps:
2929
- name: Set server major version environment
30-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
30+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
3131
with:
3232
github-token: ${{secrets.GITHUB_TOKEN}}
3333
script: |
@@ -37,13 +37,13 @@ jobs:
3737
if (match) {
3838
console.log('Setting server_major to ' + match[1]);
3939
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));
40+
console.log('Setting current_day to ' + (new Date()).toISOString().substr(0, 10));
41+
core.exportVariable('current_day', (new Date()).toISOString().substr(0, 10));
4242
}
4343
4444
- name: Checking if server ${{ env.server_major }} is EOL
4545
if: ${{ env.server_major != '' }}
4646
run: |
4747
curl -s https://raw.githubusercontent.com/nextcloud-releases/updater_server/production/config/major_versions.json \
48-
| jq '.["${{ env.server_major }}"]["eol"] // "9999-99" | . >= "${{ env.current_month }}"' \
48+
| jq '.["${{ env.server_major }}"]["eol"] // "9999-99-99" | . >= "${{ env.current_day }}"' \
4949
| grep -q true

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
steps:
3131
- name: Register server reference to fallback to master branch
32-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
32+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
3333
with:
3434
github-token: ${{secrets.GITHUB_TOKEN}}
3535
script: |

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

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

2828
steps:
2929
- name: Checkout
30-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
30+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
3131
with:
3232
persist-credentials: false
3333

.github/workflows/command-compile.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
steps:
3232
- name: Get repository from pull request comment
33-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
33+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
3434
id: get-repository
3535
with:
3636
github-token: ${{secrets.GITHUB_TOKEN}}
@@ -57,7 +57,7 @@ jobs:
5757
require: write
5858

5959
- name: Add reaction on start
60-
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
60+
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
6161
with:
6262
token: ${{ secrets.COMMAND_BOT_PAT }}
6363
repository: ${{ github.event.repository.full_name }}
@@ -83,7 +83,7 @@ jobs:
8383
id: comment-branch
8484

8585
- name: Add reaction on failure
86-
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
86+
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
8787
if: failure()
8888
with:
8989
token: ${{ secrets.COMMAND_BOT_PAT }}
@@ -103,7 +103,7 @@ jobs:
103103
key: git-repo
104104

105105
- name: Checkout ${{ needs.init.outputs.head_ref }}
106-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
106+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
107107
with:
108108
# Needed to allow force push later
109109
persist-credentials: true
@@ -120,11 +120,11 @@ jobs:
120120
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
121121
id: package-engines-versions
122122
with:
123-
fallbackNode: '^20'
124-
fallbackNpm: '^10'
123+
fallbackNode: '^24'
124+
fallbackNpm: '^11.3'
125125

126126
- name: Set up node ${{ steps.package-engines-versions.outputs.nodeVersion }}
127-
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
127+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
128128
with:
129129
node-version: ${{ steps.package-engines-versions.outputs.nodeVersion }}
130130
cache: npm
@@ -136,26 +136,26 @@ jobs:
136136
if: ${{ contains(needs.init.outputs.arg1, 'rebase') }}
137137
run: |
138138
git fetch origin '${{ needs.init.outputs.base_ref }}:${{ needs.init.outputs.base_ref }}'
139-
139+
140140
# Start the rebase
141141
git rebase 'origin/${{ needs.init.outputs.base_ref }}' || {
142142
# Handle rebase conflicts in a loop
143143
while [ -d .git/rebase-merge ] || [ -d .git/rebase-apply ]; do
144144
echo "Handling rebase conflict..."
145-
145+
146146
# Remove and checkout /dist and /js folders from the base branch
147147
if [ -d "dist" ]; then
148148
rm -rf dist
149149
git checkout origin/${{ needs.init.outputs.base_ref }} -- dist/ 2>/dev/null || echo "No dist folder in base branch"
150150
fi
151151
if [ -d "js" ]; then
152-
rm -rf js
152+
rm -rf js
153153
git checkout origin/${{ needs.init.outputs.base_ref }} -- js/ 2>/dev/null || echo "No js folder in base branch"
154154
fi
155-
155+
156156
# Stage all changes
157157
git add .
158-
158+
159159
# Check if there are any changes after resolving conflicts
160160
if git diff --cached --quiet; then
161161
echo "No changes after conflict resolution, skipping commit"
@@ -164,7 +164,7 @@ jobs:
164164
echo "Changes found, continuing rebase without editing commit message"
165165
git -c core.editor=true rebase --continue
166166
fi
167-
167+
168168
# Break if rebase is complete
169169
if [ ! -d .git/rebase-merge ] && [ ! -d .git/rebase-apply ]; then
170170
break
@@ -213,7 +213,7 @@ jobs:
213213
run: git push --force-with-lease origin "$HEAD_REF"
214214

215215
- name: Add reaction on failure
216-
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
216+
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
217217
if: failure()
218218
with:
219219
token: ${{ secrets.COMMAND_BOT_PAT }}

.github/workflows/cypress.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222
# Usually it's the base branch of the PR, but for pushes it's the branch itself.
2323
# e.g. 'main', 'stable27' or 'feature/my-feature'
2424
# n.b. server will use head_ref, as we want to test the PR branch.
25-
BRANCH: ${{ github.head_ref || github.ref_name }}
25+
BRANCH: ${{ github.base_ref || github.ref_name }}
2626

2727

2828
permissions:
@@ -48,7 +48,7 @@ jobs:
4848
exit 1
4949
5050
- name: Checkout server
51-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
51+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
5252
with:
5353
persist-credentials: false
5454
# We need to checkout submodules for 3rdparty
@@ -58,7 +58,7 @@ jobs:
5858
id: check_composer
5959
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
6060
with:
61-
files: "composer.json"
61+
files: 'composer.json'
6262

6363
- name: Install composer dependencies
6464
if: steps.check_composer.outputs.files_exists == 'true'
@@ -68,11 +68,11 @@ jobs:
6868
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
6969
id: versions
7070
with:
71-
fallbackNode: "^20"
72-
fallbackNpm: "^10"
71+
fallbackNode: '^24'
72+
fallbackNpm: '^11.3'
7373

7474
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
75-
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
75+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
7676
with:
7777
node-version: ${{ steps.versions.outputs.nodeVersion }}
7878

@@ -84,9 +84,6 @@ jobs:
8484
npm ci
8585
TESTING=true npm run build --if-present
8686
87-
- name: Show cypress version
88-
run: npm run cypress:version
89-
9087
- name: Save context
9188
uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
9289
with:
@@ -163,7 +160,7 @@ jobs:
163160
path: ./
164161

165162
- name: Set up node ${{ needs.init.outputs.nodeVersion }}
166-
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
163+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
167164
with:
168165
node-version: ${{ needs.init.outputs.nodeVersion }}
169166

@@ -174,7 +171,7 @@ jobs:
174171
run: ./node_modules/cypress/bin/cypress install
175172

176173
- name: Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }} cypress tests
177-
uses: cypress-io/github-action@b8ba51a856ba5f4c15cf39007636d4ab04f23e3c # v6.10.2
174+
uses: cypress-io/github-action@7ef72e250a9e564efb4ed4c2433971ada4cc38b4 # v6.10.4
178175
with:
179176
# We already installed the dependencies in the init job
180177
install: false
@@ -198,10 +195,10 @@ jobs:
198195
SETUP_TESTING: ${{ matrix.containers == 'setup' && 'true' || '' }}
199196

200197
- name: Upload snapshots and videos
201-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
198+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
202199
if: always()
203200
with:
204-
name: snapshots_videos_${{ matrix.containers }}
201+
name: snapshots_${{ matrix.containers }}
205202
path: |
206203
cypress/snapshots
207204
cypress/videos
@@ -220,8 +217,8 @@ jobs:
220217
if: failure() && matrix.containers != 'component'
221218
run: docker exec nextcloud-e2e-test-server_${{ env.APP_NAME }} tar -cvjf - data > data.tar
222219

223-
- name: Upload data dir archive
224-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
220+
- name: Upload data archive
221+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
225222
if: failure() && matrix.containers != 'component'
226223
with:
227224
name: nc_data_${{ matrix.containers }}

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

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
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:
1212
pull_request_target: # zizmor: ignore[dangerous-triggers]
@@ -29,6 +29,8 @@ jobs:
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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,19 @@ jobs:
5656

5757
steps:
5858
- name: Checkout
59-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
59+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
6060
with:
6161
persist-credentials: false
6262

6363
- name: Read package.json node and npm engines version
6464
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
6565
id: versions
6666
with:
67-
fallbackNode: '^20'
68-
fallbackNpm: '^10'
67+
fallbackNode: '^24'
68+
fallbackNpm: '^11.3'
6969

7070
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
71-
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
71+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
7272
with:
7373
node-version: ${{ steps.versions.outputs.nodeVersion }}
7474

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ jobs:
4444
lint:
4545
runs-on: ubuntu-latest
4646

47-
name: PHP CS fixer lint
47+
name: php-cs
4848

4949
steps:
5050
- name: Checkout
51-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
51+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
5252
with:
5353
persist-credentials: false
5454

55-
- name: Set up php8.1
56-
uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 # v2.35.4
55+
- name: Set up php
56+
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5
5757
with:
5858
php-version: 8.2
5959
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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,15 @@ jobs:
5353

5454
steps:
5555
- name: Checkout
56-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
56+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
5757
with:
5858
persist-credentials: false
5959

6060
- name: Set up php ${{ matrix.php-versions }}
61-
uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 # v2.35.4
61+
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5
6262
with:
6363
php-version: ${{ matrix.php-versions }}
64+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
6465
coverage: none
6566
ini-file: development
6667
env:

.github/workflows/lint-stylelint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ jobs:
2525

2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
2929
with:
3030
persist-credentials: false
3131

3232
- name: Read package.json node and npm engines version
3333
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
3434
id: versions
3535
with:
36-
fallbackNode: '^20'
37-
fallbackNpm: '^10'
36+
fallbackNode: '^24'
37+
fallbackNpm: '^11.3'
3838

3939
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
40-
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
40+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
4141
with:
4242
node-version: ${{ steps.versions.outputs.nodeVersion }}
4343

0 commit comments

Comments
 (0)