Skip to content

Commit 4981b7d

Browse files
committed
chore: update workflows from organization
Signed-off-by: Ferdinand Thiessen <[email protected]>
1 parent 141d6bd commit 4981b7d

8 files changed

Lines changed: 88 additions & 229 deletions

File tree

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

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# This workflow is provided via the organization template repository
22
#
3-
# https://github.com/nextcloud/.github
3+
# https://github.com/nextcloud-libraries/.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/documentation.yml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This workflow is provided via the organization template repository
22
#
3-
# https://github.com/nextcloud/.github
3+
# https://github.com/nextcloud-libraries/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55
#
66
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
@@ -14,40 +14,30 @@ on:
1414
types: [published]
1515

1616
permissions:
17-
contents: read
17+
contents: write
1818

1919
jobs:
2020
build-and-deploy:
2121
runs-on: ubuntu-latest
2222

2323
name: Build and deploy
2424
steps:
25-
- name: Check actor permission level
26-
# Only allow admin to deploy on release
27-
if: github.event.release
28-
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v2
29-
with:
30-
require: write
31-
3225
- name: Checkout
33-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3427
with:
3528
persist-credentials: false
3629

37-
- name: Read package.json node and npm engines version
38-
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
30+
- name: Read package.json
31+
uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0
3932
id: versions
40-
with:
41-
fallbackNode: '^20'
42-
fallbackNpm: '^10'
4333

44-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
45-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
34+
- name: Set up node
35+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
4636
with:
47-
node-version: ${{ steps.versions.outputs.nodeVersion }}
37+
node-version: ${{ steps.versions.outputs.node-version }}
4838

49-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
50-
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
39+
- name: Set up npm
40+
run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}'
5141

5242
- name: Install dependencies & build
5343
env:

.github/workflows/lint-eslint.yml

Lines changed: 10 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This workflow is provided via the organization template repository
22
#
3-
# https://github.com/nextcloud/.github
3+
# https://github.com/nextcloud-libraries/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55
#
66
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
@@ -18,62 +18,28 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
jobs:
21-
changes:
22-
runs-on: ubuntu-latest
23-
permissions:
24-
contents: read
25-
pull-requests: read
26-
27-
outputs:
28-
src: ${{ steps.changes.outputs.src}}
29-
30-
steps:
31-
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
32-
id: changes
33-
continue-on-error: true
34-
with:
35-
filters: |
36-
src:
37-
- '.github/workflows/**'
38-
- 'src/**'
39-
- 'appinfo/info.xml'
40-
- 'package.json'
41-
- 'package-lock.json'
42-
- 'tsconfig.json'
43-
- '.eslintrc.*'
44-
- '.eslintignore'
45-
- '**.js'
46-
- '**.ts'
47-
- '**.vue'
48-
4921
lint:
5022
runs-on: ubuntu-latest
5123

52-
needs: changes
53-
if: needs.changes.outputs.src != 'false'
54-
55-
name: NPM lint
24+
name: eslint
5625

5726
steps:
5827
- name: Checkout
59-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6029
with:
6130
persist-credentials: false
6231

63-
- name: Read package.json node and npm engines version
64-
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
32+
- name: Read package.json
33+
uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0
6534
id: versions
66-
with:
67-
fallbackNode: '^20'
68-
fallbackNpm: '^10'
6935

70-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
71-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
36+
- name: Set up node
37+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
7238
with:
73-
node-version: ${{ steps.versions.outputs.nodeVersion }}
39+
node-version: ${{ steps.versions.outputs.node-version }}
7440

75-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
76-
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
41+
- name: Set up npm
42+
run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}'
7743

7844
- name: Install dependencies
7945
env:
@@ -83,18 +49,3 @@ jobs:
8349

8450
- name: Lint
8551
run: npm run lint
86-
87-
summary:
88-
permissions:
89-
contents: none
90-
runs-on: ubuntu-latest
91-
needs: [changes, lint]
92-
93-
if: always()
94-
95-
# This is the summary, we just avoid to rename it so that branch protection rules still match
96-
name: eslint
97-
98-
steps:
99-
- name: Summary status
100-
run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi

.github/workflows/lint-prettier.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,21 @@ jobs:
4949

5050
steps:
5151
- name: Checkout
52-
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
52+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
53+
with:
54+
persist-credentials: false
5355

54-
- name: Read package.json node and npm engines version
55-
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
56+
- name: Read package.json
57+
uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0
5658
id: versions
57-
with:
58-
fallbackNode: '^20'
59-
fallbackNpm: '^10'
6059

61-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
62-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3
60+
- name: Set up node
61+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
6362
with:
64-
node-version: ${{ steps.versions.outputs.nodeVersion }}
63+
node-version: ${{ steps.versions.outputs.node-version }}
6564

66-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
67-
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
65+
- name: Set up npm
66+
run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}'
6867

6968
- name: Install dependencies
7069
env:

.github/workflows/node-test.yml

Lines changed: 13 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This workflow is provided via the organization template repository
22
#
3-
# https://github.com/nextcloud/.github
3+
# https://github.com/nextcloud-libraries/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55
#
66
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
@@ -24,60 +24,27 @@ concurrency:
2424
cancel-in-progress: true
2525

2626
jobs:
27-
changes:
28-
runs-on: ubuntu-latest
29-
permissions:
30-
contents: read
31-
pull-requests: read
32-
33-
outputs:
34-
src: ${{ steps.changes.outputs.src}}
35-
36-
steps:
37-
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
38-
id: changes
39-
continue-on-error: true
40-
with:
41-
filters: |
42-
src:
43-
- '.github/workflows/**'
44-
- '__tests__/**'
45-
- '__mocks__/**'
46-
- 'src/**'
47-
- 'appinfo/info.xml'
48-
- 'package.json'
49-
- 'package-lock.json'
50-
- 'tsconfig.json'
51-
- '**.js'
52-
- '**.ts'
53-
- '**.vue'
54-
5527
test:
5628
runs-on: ubuntu-latest
57-
58-
needs: changes
59-
if: needs.changes.outputs.src != 'false'
29+
name: node-tests
6030

6131
steps:
6232
- name: Checkout
63-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
33+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6434
with:
6535
persist-credentials: false
6636

67-
- name: Read package.json node and npm engines version
68-
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
37+
- name: Read package.json
38+
uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0
6939
id: versions
70-
with:
71-
fallbackNode: '^20'
72-
fallbackNpm: '^10'
7340

74-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
75-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
41+
- name: Set up node
42+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
7643
with:
77-
node-version: ${{ steps.versions.outputs.nodeVersion }}
44+
node-version: ${{ steps.versions.outputs.node-version }}
7845

79-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
80-
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
46+
- name: Set up npm
47+
run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}'
8148

8249
- name: Install dependencies & build
8350
env:
@@ -93,20 +60,8 @@ jobs:
9360
run: npm run test:coverage --if-present
9461

9562
- name: Collect coverage
96-
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2
63+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
9764
with:
9865
files: ./coverage/lcov.info
99-
100-
summary:
101-
permissions:
102-
contents: none
103-
runs-on: ubuntu-latest
104-
needs: [changes, test]
105-
106-
if: always()
107-
108-
name: test-summary
109-
110-
steps:
111-
- name: Summary status
112-
run: if ${{ needs.changes.outputs.src != 'false' && needs.test.result != 'success' }}; then exit 1; fi
66+
env:
67+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)