Skip to content

Commit 2312929

Browse files
committed
chore: update workflows from templates
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
1 parent 9090251 commit 2312929

7 files changed

Lines changed: 75 additions & 42 deletions

File tree

.github/workflows/appstore-build-publish.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
types: [published]
1111

1212
env:
13-
PHP_VERSION: 7.4
13+
PHP_VERSION: 8.1
1414

1515
jobs:
1616
build_and_publish:
@@ -21,42 +21,42 @@ jobs:
2121

2222
steps:
2323
- name: Check actor permission
24-
uses: skjnldsv/check-actor-permission@v2
24+
uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2.1
2525
with:
2626
require: write
2727

2828
- name: Set app env
2929
run: |
30-
# Split and keep last
30+
# Split and keep last
3131
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
3232
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
3333
3434
- name: Checkout
35-
uses: actions/checkout@v3
35+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
3636
with:
3737
path: ${{ env.APP_NAME }}
3838

3939
- name: Get appinfo data
4040
id: appinfo
41-
uses: skjnldsv/xpath-action@master
41+
uses: skjnldsv/xpath-action@7e6a7c379d0e9abc8acaef43df403ab4fc4f770c # master
4242
with:
4343
filename: ${{ env.APP_NAME }}/appinfo/info.xml
4444
expression: "//info//dependencies//nextcloud/@min-version"
4545

4646
- name: Read package.json node and npm engines version
47-
uses: skjnldsv/read-package-engines-version-actions@v1.2
47+
uses: skjnldsv/read-package-engines-version-actions@1bdcee71fa343c46b18dc6aceffb4cd1e35209c6 # v1.2
4848
id: versions
4949
# Continue if no package.json
5050
continue-on-error: true
5151
with:
5252
path: ${{ env.APP_NAME }}
53-
fallbackNode: "^12"
54-
fallbackNpm: "^6"
53+
fallbackNode: "^16"
54+
fallbackNpm: "^7"
5555

5656
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
5757
# Skip if no package.json
5858
if: ${{ steps.versions.outputs.nodeVersion }}
59-
uses: actions/setup-node@v3
59+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3
6060
with:
6161
node-version: ${{ steps.versions.outputs.nodeVersion }}
6262

@@ -66,14 +66,16 @@ jobs:
6666
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
6767

6868
- name: Set up php ${{ env.PHP_VERSION }}
69-
uses: shivammathur/setup-php@v2
69+
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
7070
with:
7171
php-version: ${{ env.PHP_VERSION }}
7272
coverage: none
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7375

7476
- name: Check composer.json
7577
id: check_composer
76-
uses: andstor/file-existence-action@v1
78+
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
7779
with:
7880
files: "${{ env.APP_NAME }}/composer.json"
7981

@@ -93,15 +95,15 @@ jobs:
9395
9496
- name: Check Krankerl config
9597
id: krankerl
96-
uses: andstor/file-existence-action@v1
98+
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
9799
with:
98100
files: ${{ env.APP_NAME }}/krankerl.toml
99101

100102
- name: Install Krankerl
101103
if: steps.krankerl.outputs.files_exists == 'true'
102104
run: |
103-
wget https://github.com/ChristophWurst/krankerl/releases/download/v0.13.0/krankerl_0.13.0_amd64.deb
104-
sudo dpkg -i krankerl_0.13.0_amd64.deb
105+
wget https://github.com/ChristophWurst/krankerl/releases/download/v0.14.0/krankerl_0.14.0_amd64.deb
106+
sudo dpkg -i krankerl_0.14.0_amd64.deb
105107
106108
- name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with krankerl
107109
if: steps.krankerl.outputs.files_exists == 'true'
@@ -124,9 +126,10 @@ jobs:
124126
unzip latest-$NCVERSION.zip
125127
126128
- name: Checkout server master fallback
127-
uses: actions/checkout@v3
129+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
128130
if: ${{ steps.server-checkout.outcome != 'success' }}
129131
with:
132+
submodules: true
130133
repository: nextcloud/server
131134
path: nextcloud
132135

@@ -146,7 +149,7 @@ jobs:
146149
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
147150
148151
- name: Attach tarball to github release
149-
uses: svenstaro/upload-release-action@v2
152+
uses: svenstaro/upload-release-action@133984371c30d34e38222a64855679a414cb7575 # v2
150153
id: attach_to_release
151154
with:
152155
repo_token: ${{ secrets.GITHUB_TOKEN }}
@@ -156,7 +159,7 @@ jobs:
156159
overwrite: true
157160

158161
- name: Upload app to Nextcloud appstore
159-
uses: nextcloud-releases/nextcloud-appstore-push-action@v1
162+
uses: nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1 # v1
160163
with:
161164
app_name: ${{ env.APP_NAME }}
162165
appstore_token: ${{ secrets.APPSTORE_TOKEN }}

.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/fixup.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,31 @@
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 fixup and squash commits
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: fixup-${{ github.head_ref || github.run_id }}
17+
cancel-in-progress: true
918

1019
jobs:
1120
commit-message-check:
21+
if: github.event.pull_request.draft == false
22+
23+
permissions:
24+
pull-requests: write
1225
name: Block fixup and squash commits
1326

1427
runs-on: ubuntu-latest
1528

1629
steps:
1730
- name: Run check
18-
uses: xt0rted/block-autosquash-commits-action@v2
31+
uses: xt0rted/block-autosquash-commits-action@79880c36b4811fe549cfffe20233df88876024e7 # v2
1932
with:
2033
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint-info-xml.yml

Lines changed: 10 additions & 3 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 info.xml
77

88
on:
99
pull_request:
@@ -13,20 +13,27 @@ on:
1313
- master
1414
- stable*
1515

16+
permissions:
17+
contents: read
18+
19+
concurrency:
20+
group: lint-info-xml-${{ github.head_ref || github.run_id }}
21+
cancel-in-progress: true
22+
1623
jobs:
1724
xml-linters:
1825
runs-on: ubuntu-latest
1926

2027
name: info.xml lint
2128
steps:
2229
- name: Checkout
23-
uses: actions/checkout@v3
30+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
2431

2532
- name: Download schema
2633
run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd
2734

2835
- name: Lint info.xml
29-
uses: ChristophWurst/xmllint-action@v1
36+
uses: ChristophWurst/xmllint-action@d18a551aab4728e4af449617638600634d7a48cb # v1
3037
with:
3138
xml-file: ./appinfo/info.xml
3239
xml-schema-file: ./info.xsd

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
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

1010
permissions:
1111
contents: read
1212

13-
concurrency:
13+
concurrency:
1414
group: lint-php-cs-${{ github.head_ref || github.run_id }}
1515
cancel-in-progress: true
1616

@@ -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: "7.4"
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

0 commit comments

Comments
 (0)