Skip to content

Commit ae4a155

Browse files
authored
Merge pull request #1114 from nextcloud-libraries/chore/workflows
chore: update workflows from organization
2 parents 737d936 + cdf321f commit ae4a155

8 files changed

Lines changed: 83 additions & 189 deletions

File tree

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

Lines changed: 3 additions & 3 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
@@ -9,7 +9,7 @@
99
name: Dependabot
1010

1111
on:
12-
pull_request_target:
12+
pull_request_target: # zizmor: ignore[dangerous-triggers]
1313
branches:
1414
- main
1515
- master
@@ -24,7 +24,7 @@ concurrency:
2424

2525
jobs:
2626
auto-approve-merge:
27-
if: github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]'
27+
if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'renovate[bot]'
2828
runs-on: ubuntu-latest
2929
permissions:
3030
# for hmarr/auto-approve-action to approve PRs

.github/workflows/documentation.yml

Lines changed: 7 additions & 19 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
@@ -13,36 +13,24 @@ on:
1313
release:
1414
types: [published]
1515

16+
permissions:
17+
contents: write
18+
1619
jobs:
1720
build-and-deploy:
1821
runs-on: ubuntu-latest
1922

2023
name: Build and deploy
2124
steps:
22-
- name: Check actor permission level
23-
# Only allow admin to deploy on release
24-
if: github.event.release
25-
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v2
26-
with:
27-
require: admin
28-
2925
- name: Checkout
3026
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
31-
32-
- name: Read package.json node and npm engines version
33-
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
34-
id: versions
3527
with:
36-
fallbackNode: '^20'
37-
fallbackNpm: '^10'
28+
persist-credentials: false
3829

39-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
30+
- name: Set up node
4031
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4132
with:
42-
node-version: ${{ steps.versions.outputs.nodeVersion }}
43-
44-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
45-
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
33+
node-version-file: 'package.json'
4634

4735
- name: Install dependencies & build
4836
env:

.github/workflows/fixup.yml

Lines changed: 1 addition & 1 deletion
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

.github/workflows/l10n.yml

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,33 @@
1-
# SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
2-
# SPDX-License-Identifier: GPL-3.0-or-later
1+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: MIT
3+
34
name: L10n
45
on: pull_request
56

7+
permissions:
8+
contents: read
9+
610
jobs:
711
l10n-extract-check:
812
runs-on: ubuntu-latest
13+
914
name: Pot check
1015
steps:
11-
- name: Checkout
12-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
13-
14-
- name: Read package.json node and npm engines version
15-
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
16-
id: versions
17-
with:
18-
fallbackNode: '^20'
19-
fallbackNpm: '^10'
20-
21-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
22-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v3
23-
with:
24-
node-version: ${{ steps.versions.outputs.nodeVersion }}
25-
26-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
27-
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
28-
29-
- name: Install dependencies
30-
env:
31-
CYPRESS_INSTALL_BINARY: 0
32-
PUPPETEER_SKIP_DOWNLOAD: true
33-
run: npm ci
34-
35-
- name: Extract l10n files
36-
run: npm run l10n:extract
37-
38-
- name: Check l10n file changes
39-
run: bash -c "[[ ! \"`git status --porcelain l10n`\" ]] || ( echo 'Uncommited l10n changes. Run `npm l10n:extract`.' && git status && exit 1 )"
16+
- name: Checkout
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
with:
19+
persist-credentials: false
20+
21+
- name: Set up node
22+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
23+
with:
24+
node-version-file: 'package.json'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Extract l10n files
30+
run: npm run l10n:extract
31+
32+
- name: Check l10n file changes
33+
run: bash -c "[[ ! \"`git status --porcelain l10n`\" ]] || ( echo 'Uncommited l10n changes. Run \`npm run l10n:extract\`.' && exit 1 )"

.github/workflows/lint-eslint.yml

Lines changed: 5 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,60 +18,21 @@ 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
5928
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
60-
61-
- name: Read package.json node and npm engines version
62-
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
63-
id: versions
6429
with:
65-
fallbackNode: '^20'
66-
fallbackNpm: '^10'
30+
persist-credentials: false
6731

68-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
32+
- name: Set up node
6933
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
7034
with:
71-
node-version: ${{ steps.versions.outputs.nodeVersion }}
72-
73-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
74-
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
35+
node-version-file: 'package.json'
7536

7637
- name: Install dependencies
7738
env:
@@ -81,18 +42,3 @@ jobs:
8142

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

.github/workflows/node-test.yml

Lines changed: 5 additions & 57 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,58 +24,20 @@ 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
6333
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
64-
65-
- name: Read package.json node and npm engines version
66-
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
67-
id: versions
6834
with:
69-
fallbackNode: '^20'
70-
fallbackNpm: '^10'
35+
persist-credentials: false
7136

72-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
37+
- name: Set up node
7338
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
7439
with:
75-
node-version: ${{ steps.versions.outputs.nodeVersion }}
76-
77-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
78-
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
40+
node-version-file: 'package.json'
7941

8042
- name: Install dependencies & build
8143
env:
@@ -94,17 +56,3 @@ jobs:
9456
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
9557
with:
9658
files: ./coverage/lcov.info
97-
98-
summary:
99-
permissions:
100-
contents: none
101-
runs-on: ubuntu-latest
102-
needs: [changes, test]
103-
104-
if: always()
105-
106-
name: test-summary
107-
108-
steps:
109-
- name: Summary status
110-
run: if ${{ needs.changes.outputs.src != 'false' && needs.test.result != 'success' }}; then exit 1; fi

0 commit comments

Comments
 (0)