Skip to content

Commit d0ee4a9

Browse files
committed
ci: Update actions
Signed-off-by: Joas Schilling <[email protected]>
1 parent e2a7383 commit d0ee4a9

File tree

4 files changed

+41
-11
lines changed

4 files changed

+41
-11
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/composer-auto.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
name: Compile Command
2+
23
on:
34
issue_comment:
45
types: [created]
56

7+
permissions:
8+
contents: read
9+
610
jobs:
711
init:
812
runs-on: ubuntu-latest
@@ -37,20 +41,20 @@ jobs:
3741
exit 1
3842
3943
- name: Check actor permission
40-
uses: skjnldsv/check-actor-permission@v3
44+
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0
4145
with:
4246
require: write
4347

4448
- name: Add reaction on start
45-
uses: peter-evans/create-or-update-comment@v4
49+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
4650
with:
4751
token: ${{ secrets.COMMAND_BOT_PAT }}
4852
repository: ${{ github.event.repository.full_name }}
4953
comment-id: ${{ github.event.comment.id }}
5054
reactions: '+1'
5155

5256
- name: Init branch
53-
uses: xt0rted/pull-request-comment-branch@v3
57+
uses: xt0rted/pull-request-comment-branch@e8b8daa837e8ea7331c0003c9c316a64c6d8b0b1 # v3.0.0
5458
id: comment-branch
5559

5660
- name: Add reaction on failure
@@ -70,6 +74,7 @@ jobs:
7074
- name: Checkout ${{ needs.init.outputs.head_ref }}
7175
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
7276
with:
77+
persist-credentials: false
7378
token: ${{ secrets.COMMAND_BOT_PAT }}
7479
fetch-depth: 0
7580
ref: ${{ needs.init.outputs.head_ref }}
@@ -80,7 +85,7 @@ jobs:
8085
git config --local user.name 'nextcloud-command'
8186
8287
- name: Set up php
83-
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 #v2.32.0
88+
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0
8489
with:
8590
php-version: 8.1
8691
coverage: none
@@ -107,7 +112,7 @@ jobs:
107112
git push --force origin '${{ needs.init.outputs.head_ref }}'
108113
109114
- name: Add reaction on failure
110-
uses: peter-evans/create-or-update-comment@v4
115+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
111116
if: failure()
112117
with:
113118
token: ${{ secrets.COMMAND_BOT_PAT }}

.github/workflows/composer.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,22 @@ on:
77
- master
88
- stable*
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
php:
1215
runs-on: ubuntu-latest
1316

1417
name: Check vendor changes
1518
steps:
1619
- name: Checkout
17-
uses: actions/checkout@master
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
with:
22+
persist-credentials: false
1823

1924
- name: Set up php
20-
uses: shivammathur/setup-php@master
25+
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0
2126
with:
2227
php-version: 8.1
2328
coverage: none

.github/workflows/lint-php.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ jobs:
1919
runs-on: ubuntu-latest
2020
strategy:
2121
matrix:
22-
php-versions: [ '8.1', '8.2', '8.3' ]
22+
php-versions: [ '8.1', '8.2', '8.3', '8.4' ]
2323

2424
name: php-lint
2525

2626
steps:
2727
- name: Checkout
2828
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
with:
30+
persist-credentials: false
2931

3032
- name: Set up php ${{ matrix.php-versions }}
3133
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 #v2.32.0

0 commit comments

Comments
 (0)