Skip to content

Commit 95caaeb

Browse files
authored
Merge pull request #6841 from nextcloud-libraries/chore/update-workflows
chore: update workflows from organization
2 parents a4b2100 + e525298 commit 95caaeb

12 files changed

+100
-128
lines changed

.github/workflows/block-unconventional-commits.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: 2024 Nextcloud GmbH and Nextcloud contributors

.github/workflows/command-l10n-update.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud-libraries/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
27
# SPDX-License-Identifier: MIT
8+
39
name: Command L10n Update
410
on:
511
issue_comment:
@@ -18,19 +24,19 @@ jobs:
1824

1925
steps:
2026
- name: Add reaction on start
21-
uses: peter-evans/create-or-update-comment@v4
27+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
2228
with:
2329
token: ${{ secrets.COMMAND_BOT_PAT }}
2430
repository: ${{ github.event.repository.full_name }}
2531
comment-id: ${{ github.event.comment.id }}
2632
reaction-type: "+1"
2733

2834
- name: Parse command
29-
uses: skjnldsv/parse-command-comment@master
35+
uses: skjnldsv/parse-command-comment@5c955203c52424151e6d0e58fb9de8a9f6a605a1 # v3.1.0
3036
id: command
3137

3238
- name: Init branch
33-
uses: xt0rted/pull-request-comment-branch@v3
39+
uses: xt0rted/pull-request-comment-branch@e8b8daa837e8ea7331c0003c9c316a64c6d8b0b1 # v3.0.0
3440
id: comment-branch
3541

3642
process:
@@ -51,7 +57,7 @@ jobs:
5157
git config --local user.name "nextcloud-command"
5258
5359
- name: Set up node
54-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3
60+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
5561
with:
5662
node-version-file: package.json
5763

@@ -82,7 +88,7 @@ jobs:
8288
git push --force origin ${{ needs.init.outputs.head_ref }}
8389
8490
- name: Add reaction on failure
85-
uses: peter-evans/create-or-update-comment@v4
91+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
8692
if: failure()
8793
with:
8894
token: ${{ secrets.COMMAND_BOT_PAT }}

.github/workflows/command-playwright-update.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud-libraries/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
16
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
27
# SPDX-License-Identifier: MIT
38

9+
# Usage:
10+
# /update-snapshots - update the snapshots and commit as a new commit
11+
# /update-snapshots fixup - update but commit as a fixup commit
12+
# /update-snapshots amend - update and commit as amended commit
13+
414
name: Command update Playwright snapshots
515
on:
616
issue_comment:

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

Lines changed: 9 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,13 +24,19 @@ 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
3131
pull-requests: write
3232

3333
steps:
34+
- name: Disabled on forks
35+
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
36+
run: |
37+
echo 'Can not approve PRs from forks'
38+
exit 1
39+
3440
# GitHub actions bot approve
3541
- uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
3642
with:

.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/lint-eslint.yml

Lines changed: 6 additions & 47 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,47 +18,21 @@ concurrency:
1818
cancel-in-progress: true
1919

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

49-
needs: changes
50-
if: needs.changes.outputs.src != 'false'
51-
52-
name: NPM lint
24+
name: eslint
5325

5426
steps:
5527
- name: Checkout
5628
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
with:
30+
persist-credentials: false
5731

5832
- name: Set up node
59-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3
33+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
6034
with:
61-
node-version-file: package.json
35+
node-version-file: 'package.json'
6236

6337
- name: Install dependencies
6438
env:
@@ -68,18 +42,3 @@ jobs:
6842

6943
- name: Lint
7044
run: npm run lint
71-
72-
summary:
73-
permissions:
74-
contents: none
75-
runs-on: ubuntu-latest
76-
needs: [changes, lint]
77-
78-
if: always()
79-
80-
# This is the summary, we just avoid to rename it so that branch protection rules still match
81-
name: eslint
82-
83-
steps:
84-
- name: Summary status
85-
run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi

.github/workflows/lint-stylelint.yml

Lines changed: 5 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
@@ -26,11 +26,13 @@ jobs:
2626
steps:
2727
- name: Checkout
2828
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
with:
30+
persist-credentials: false
2931

3032
- name: Set up node
31-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3
33+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3234
with:
33-
node-version-file: package.json
35+
node-version-file: 'package.json'
3436

3537
- name: Install dependencies
3638
env:

.github/workflows/node-test.yml

Lines changed: 6 additions & 45 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,45 +24,20 @@ concurrency:
2424
cancel-in-progress: true
2525

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

5831
steps:
5932
- name: Checkout
6033
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
with:
35+
persist-credentials: false
6136

6237
- name: Set up node
63-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3
38+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
6439
with:
65-
node-version-file: package.json
40+
node-version-file: 'package.json'
6641

6742
- name: Install dependencies & build
6843
env:
@@ -81,17 +56,3 @@ jobs:
8156
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
8257
with:
8358
files: ./coverage/lcov.info
84-
85-
summary:
86-
permissions:
87-
contents: none
88-
runs-on: ubuntu-latest
89-
needs: [changes, test]
90-
91-
if: always()
92-
93-
name: test-summary
94-
95-
steps:
96-
- name: Summary status
97-
run: if ${{ needs.changes.outputs.src != 'false' && needs.test.result != 'success' }}; then exit 1; fi

.github/workflows/npm-audit-fix.yml

Lines changed: 12 additions & 6 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,42 +14,48 @@ on:
1414
# At 2:30 on Sundays
1515
- cron: '30 2 * * 0'
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
build:
1922
runs-on: ubuntu-latest
2023

2124
strategy:
2225
fail-fast: false
2326
matrix:
24-
branches: ['master', 'next']
27+
branches: ['main', 'stable8']
2528

2629
name: npm-audit-fix-${{ matrix.branches }}
2730

2831
steps:
2932
- name: Checkout
33+
id: checkout
3034
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3135
with:
36+
persist-credentials: false
3237
ref: ${{ matrix.branches }}
38+
continue-on-error: true
3339

3440
- name: Set up node
35-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3
41+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3642
with:
37-
node-version-file: package.json
43+
node-version-file: 'package.json'
3844

3945
- name: Fix npm audit
4046
id: npm-audit
4147
uses: nextcloud-libraries/npm-audit-action@1b1728b2b4a7a78d69de65608efcf4db0e3e42d0 # v0.2.0
4248

4349
- name: Run npm ci and npm run build
44-
if: always()
50+
if: steps.checkout.outcome == 'success'
4551
env:
4652
CYPRESS_INSTALL_BINARY: 0
4753
run: |
4854
npm ci
4955
npm run build --if-present
5056
5157
- name: Create Pull Request
52-
if: always()
58+
if: steps.checkout.outcome == 'success'
5359
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
5460
with:
5561
token: ${{ secrets.COMMAND_BOT_PAT }}

.github/workflows/npm-publish.yml

Lines changed: 6 additions & 4 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
@@ -22,16 +22,18 @@ jobs:
2222

2323
name: Build and publish to npm
2424
env:
25-
RELEASE_GROUP: ${{ (contains(github.ref, 'beta') || contains(github.ref, 'alpha')) && 'next' || 'latest' }}
25+
RELEASE_GROUP: ${{ (contains(github.ref, 'rc') || contains(github.ref, 'beta') || contains(github.ref, 'alpha')) && 'next' || 'latest' }}
2626

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

3133
- name: Set up node
32-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3
34+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3335
with:
34-
node-version-file: package.json
36+
node-version-file: 'package.json'
3537

3638
- name: Install dependencies & build
3739
env:

0 commit comments

Comments
 (0)