Skip to content

Commit 8d1d763

Browse files
committed
chore: update workflows from templates
Signed-off-by: John Molakvoæ <[email protected]>
1 parent 4fd97d7 commit 8d1d763

14 files changed

Lines changed: 141 additions & 78 deletions

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,25 @@
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55

6-
name: Pull request checks
6+
name: Block merges during freezes
77

8-
on: pull_request
8+
on:
9+
pull_request:
10+
types: [opened, ready_for_review, reopened, synchronize]
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: block-merge-freeze-${{ github.head_ref || github.run_id }}
17+
cancel-in-progress: true
918

1019
jobs:
1120
block-merges-during-freeze:
1221
name: Block merges during freezes
1322

23+
if: github.event.pull_request.draft == false
24+
1425
runs-on: ubuntu-latest
1526

1627
steps:

.github/workflows/command-compile.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,43 +18,43 @@ jobs:
1818

1919
steps:
2020
- name: Check actor permission
21-
uses: skjnldsv/check-actor-permission@v2
21+
uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2
2222
with:
2323
require: write
2424

2525
- name: Add reaction on start
26-
uses: peter-evans/create-or-update-comment@v1
26+
uses: peter-evans/create-or-update-comment@ca08ebd5dc95aa0cd97021e9708fcd6b87138c9b # v3.0.1
2727
with:
2828
token: ${{ secrets.COMMAND_BOT_PAT }}
2929
repository: ${{ github.event.repository.full_name }}
3030
comment-id: ${{ github.event.comment.id }}
31-
reaction-type: "+1"
31+
reactions: "+1"
3232

3333
- name: Parse command
34-
uses: skjnldsv/parse-command-comment@master
34+
uses: skjnldsv/parse-command-comment@7cef1df370a99dfd5bf896d50121390c96785db8 # v2
3535
id: command
3636

3737
# Init path depending on which command is run
3838
- name: Init path
3939
id: git-path
40-
run: |
40+
run: |
4141
if ${{ startsWith(steps.command.outputs.arg1, '/') }}; then
42-
echo "::set-output name=path::${{ github.workspace }}${{steps.command.outputs.arg1}}"
42+
echo "path=${{ github.workspace }}${{steps.command.outputs.arg1}}" >> $GITHUB_OUTPUT
4343
else
44-
echo "::set-output name=path::${{ github.workspace }}${{steps.command.outputs.arg2}}"
44+
echo "path=${{ github.workspace }}${{steps.command.outputs.arg2}}" >> $GITHUB_OUTPUT
4545
fi
4646
4747
- name: Init branch
48-
uses: xt0rted/pull-request-comment-branch@v1
48+
uses: xt0rted/pull-request-comment-branch@d97294d304604fa98a2600a6e2f916a84b596dc7 # v1
4949
id: comment-branch
50-
50+
5151
process:
5252
runs-on: ubuntu-latest
5353
needs: init
5454

5555
steps:
5656
- name: Checkout ${{ needs.init.outputs.head_ref }}
57-
uses: actions/checkout@v3
57+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
5858
with:
5959
token: ${{ secrets.COMMAND_BOT_PAT }}
6060
fetch-depth: 0
@@ -66,14 +66,14 @@ jobs:
6666
git config --local user.name "nextcloud-command"
6767
6868
- name: Read package.json node and npm engines version
69-
uses: skjnldsv/read-package-engines-version-actions@v1.2
69+
uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
7070
id: package-engines-versions
7171
with:
72-
fallbackNode: '^12'
73-
fallbackNpm: '^6'
72+
fallbackNode: '^16'
73+
fallbackNpm: '^7'
7474

7575
- name: Set up node ${{ steps.package-engines-versions.outputs.nodeVersion }}
76-
uses: actions/setup-node@v3
76+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3
7777
with:
7878
node-version: ${{ steps.package-engines-versions.outputs.nodeVersion }}
7979
cache: npm
@@ -90,7 +90,7 @@ jobs:
9090
if: ${{ needs.init.outputs.arg1 != 'fixup' && needs.init.outputs.arg1 != 'amend' }}
9191
run: |
9292
git add ${{ needs.init.outputs.git_path }}
93-
git commit --signoff -m 'Compile assets'
93+
git commit --signoff -m 'chore(assets): Recompile assets'
9494
git push origin ${{ needs.init.outputs.head_ref }}
9595
9696
- name: Commit and push fixup
@@ -108,10 +108,10 @@ jobs:
108108
git push --force origin ${{ needs.init.outputs.head_ref }}
109109
110110
- name: Add reaction on failure
111-
uses: peter-evans/create-or-update-comment@v1
111+
uses: peter-evans/create-or-update-comment@ca08ebd5dc95aa0cd97021e9708fcd6b87138c9b # v3.0.1
112112
if: failure()
113113
with:
114114
token: ${{ secrets.COMMAND_BOT_PAT }}
115115
repository: ${{ github.event.repository.full_name }}
116116
comment-id: ${{ github.event.comment.id }}
117-
reaction-type: "-1"
117+
reactions: "-1"

.github/workflows/command-rebase.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99
issue_comment:
1010
types: created
1111

12-
permissions:
13-
contents: read
12+
permissions:
13+
contents: read
1414

1515
jobs:
1616
rebase:
@@ -23,26 +23,26 @@ jobs:
2323

2424
steps:
2525
- name: Add reaction on start
26-
uses: peter-evans/create-or-update-comment@v2
26+
uses: peter-evans/create-or-update-comment@ca08ebd5dc95aa0cd97021e9708fcd6b87138c9b # v3.0.1
2727
with:
2828
token: ${{ secrets.COMMAND_BOT_PAT }}
2929
repository: ${{ github.event.repository.full_name }}
3030
comment-id: ${{ github.event.comment.id }}
3131
reaction-type: "+1"
3232

3333
- name: Checkout the latest code
34-
uses: actions/checkout@v3
34+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
3535
with:
3636
fetch-depth: 0
3737
token: ${{ secrets.COMMAND_BOT_PAT }}
3838

3939
- name: Automatic Rebase
40-
uses: cirrus-actions/rebase@1.7
40+
uses: cirrus-actions/rebase@b87d48154a87a85666003575337e27b8cd65f691 # 1.8
4141
env:
4242
GITHUB_TOKEN: ${{ secrets.COMMAND_BOT_PAT }}
4343

4444
- name: Add reaction on failure
45-
uses: peter-evans/create-or-update-comment@v2
45+
uses: peter-evans/create-or-update-comment@ca08ebd5dc95aa0cd97021e9708fcd6b87138c9b # v3.0.1
4646
if: failure()
4747
with:
4848
token: ${{ secrets.COMMAND_BOT_PAT }}

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,26 @@ on:
1515
permissions:
1616
contents: read
1717

18+
concurrency:
19+
group: dependabot-approve-merge-${{ github.head_ref || github.run_id }}
20+
cancel-in-progress: true
21+
1822
jobs:
1923
auto-approve-merge:
2024
if: github.actor == 'dependabot[bot]'
2125
runs-on: ubuntu-latest
2226
permissions:
2327
# for hmarr/auto-approve-action to approve PRs
24-
pull-requests: write
28+
pull-requests: write
2529

2630
steps:
2731
# Github actions bot approve
28-
- uses: hmarr/auto-approve-action@v2
32+
- uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
2933
with:
3034
github-token: ${{ secrets.GITHUB_TOKEN }}
3135

3236
# Nextcloud bot approve and merge request
33-
- uses: ahmadnassri/action-dependabot-auto-merge@v2
37+
- uses: ahmadnassri/action-dependabot-auto-merge@45fc124d949b19b6b8bf6645b6c9d55f4f9ac61a # v2
3438
with:
3539
target: minor
3640
github-token: ${{ secrets.DEPENDABOT_AUTOMERGE_TOKEN }}

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55

6-
name: Lint
6+
name: Lint php-cs
77

88
on: pull_request
99

@@ -22,13 +22,16 @@ jobs:
2222

2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2626

2727
- name: Set up php
28-
uses: shivammathur/setup-php@v2
28+
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
2929
with:
30-
php-version: "8.0"
30+
php-version: 8.1
3131
coverage: none
32+
ini-file: development
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3235

3336
- name: Install dependencies
3437
run: composer i

.github/workflows/lint-php.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55

6-
name: Lint
6+
name: Lint php
77

88
on:
99
pull_request:
@@ -16,7 +16,7 @@ on:
1616
permissions:
1717
contents: read
1818

19-
concurrency:
19+
concurrency:
2020
group: lint-php-${{ github.head_ref || github.run_id }}
2121
cancel-in-progress: true
2222

@@ -25,19 +25,22 @@ jobs:
2525
runs-on: ubuntu-latest
2626
strategy:
2727
matrix:
28-
php-versions: ["7.4", "8.0", "8.1"]
28+
php-versions: [ "8.0", "8.1", "8.2" ]
2929

3030
name: php-lint
3131

3232
steps:
3333
- name: Checkout
34-
uses: actions/checkout@v3
34+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
3535

3636
- name: Set up php ${{ matrix.php-versions }}
37-
uses: shivammathur/setup-php@v2
37+
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
3838
with:
3939
php-version: ${{ matrix.php-versions }}
4040
coverage: none
41+
ini-file: development
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4144

4245
- name: Lint
4346
run: composer run lint

.github/workflows/node.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ name: Node
77

88
on:
99
pull_request:
10+
paths:
11+
- '.github/workflows/**'
12+
- 'src/**'
13+
- 'appinfo/info.xml'
14+
- 'package.json'
15+
- 'package-lock.json'
16+
- 'tsconfig.json'
17+
- '**.js'
18+
- '**.ts'
19+
- '**.vue'
1020
push:
1121
branches:
1222
- main
@@ -16,24 +26,28 @@ on:
1626
permissions:
1727
contents: read
1828

29+
concurrency:
30+
group: node-${{ github.head_ref || github.run_id }}
31+
cancel-in-progress: true
32+
1933
jobs:
2034
build:
2135
runs-on: ubuntu-latest
2236

2337
name: node
2438
steps:
2539
- name: Checkout
26-
uses: actions/checkout@v3
40+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2741

2842
- name: Read package.json node and npm engines version
29-
uses: skjnldsv/[email protected]
43+
uses: skjnldsv/read-package-engines-version-actions@1bdcee71fa343c46b18dc6aceffb4cd1e35209c6 # v1.2
3044
id: versions
3145
with:
32-
fallbackNode: '^12'
33-
fallbackNpm: '^6'
46+
fallbackNode: '^16'
47+
fallbackNpm: '^7'
3448

3549
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
36-
uses: actions/setup-node@v3
50+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3
3751
with:
3852
node-version: ${{ steps.versions.outputs.nodeVersion }}
3953

@@ -47,10 +61,11 @@ jobs:
4761
4862
- name: Check webpack build changes
4963
run: |
50-
bash -c "[[ ! \"`git status --porcelain `\" ]] || exit 1"
64+
bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)"
5165
5266
- name: Show changes on failure
5367
if: failure()
5468
run: |
5569
git status
5670
git --no-pager diff
71+
exit 1 # make it red to grab attention

.github/workflows/phpunit-mysql.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55

6-
name: PHPUnit
6+
name: PHPUnit mysql
77

88
on:
99
pull_request:
@@ -38,7 +38,7 @@ jobs:
3838

3939
strategy:
4040
matrix:
41-
php-versions: ['8.0', '8.1']
41+
php-versions: ['8.0', '8.1', '8.2']
4242
server-versions: ['master']
4343

4444
services:
@@ -62,23 +62,25 @@ jobs:
6262
echo "SELECT @@sql_mode;" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
6363
6464
- name: Checkout server
65-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
65+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
6666
with:
6767
submodules: true
6868
repository: nextcloud/server
6969
ref: ${{ matrix.server-versions }}
7070

7171
- name: Checkout app
72-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
72+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
7373
with:
7474
path: apps/${{ env.APP_NAME }}
7575

7676
- name: Set up php ${{ matrix.php-versions }}
7777
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
7878
with:
7979
php-version: ${{ matrix.php-versions }}
80-
extensions: mbstring, iconv, fileinfo, intl, mysql, pdo_mysql
80+
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
81+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib,mysql, pdo_mysql
8182
coverage: none
83+
ini-file: development
8284
env:
8385
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8486

@@ -99,7 +101,7 @@ jobs:
99101
DB_PORT: 4444
100102
run: |
101103
mkdir data
102-
./occ maintenance:install --verbose --database=mysql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
104+
./occ maintenance:install --verbose --database=mysql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
103105
./occ app:enable --force ${{ env.APP_NAME }}
104106
105107
- name: Check PHPUnit script is defined

0 commit comments

Comments
 (0)