Skip to content

Commit a407583

Browse files
authored
Merge pull request #1736 from nextcloud-libraries/chore/update-workflows
chore: update workflows from organization
2 parents a81ca9b + 48e9fa0 commit a407583

File tree

8 files changed

+49
-165
lines changed

8 files changed

+49
-165
lines changed

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

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
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
38

49
name: Command L10n Update
510
on:
611
issue_comment:
712
types: [created]
13+
permissions:
14+
contents: read
815

916
jobs:
1017
init:
@@ -19,62 +26,44 @@ jobs:
1926

2027
steps:
2128
- name: Add reaction on start
22-
uses: peter-evans/create-or-update-comment@v4
29+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
2330
with:
2431
token: ${{ secrets.COMMAND_BOT_PAT }}
2532
repository: ${{ github.event.repository.full_name }}
2633
comment-id: ${{ github.event.comment.id }}
2734
reaction-type: "+1"
2835

2936
- name: Parse command
30-
uses: skjnldsv/parse-command-comment@5c955203c52424151e6d0e58fb9de8a9f6a605a1 # v3.1
37+
uses: skjnldsv/parse-command-comment@5c955203c52424151e6d0e58fb9de8a9f6a605a1 # v3.1.0
3138
id: command
3239

3340
- name: Init branch
3441
uses: xt0rted/pull-request-comment-branch@e8b8daa837e8ea7331c0003c9c316a64c6d8b0b1 # v3.0.0
3542
id: comment-branch
3643

37-
- name: Add reaction on failure
38-
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
39-
if: failure()
40-
with:
41-
token: ${{ secrets.COMMAND_BOT_PAT }}
42-
repository: ${{ github.event.repository.full_name }}
43-
comment-id: ${{ github.event.comment.id }}
44-
reactions: '-1'
45-
4644
process:
4745
runs-on: ubuntu-latest
4846
needs: init
4947

5048
steps:
5149
- name: Checkout ${{ needs.init.outputs.head_ref }}
52-
uses: actions/checkout@v4
50+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5351
with:
54-
token: ${{ secrets.COMMAND_BOT_PAT }}
5552
fetch-depth: 0
5653
ref: ${{ needs.init.outputs.head_ref }}
54+
# Needed to push changes
55+
persist-credentials: true
56+
token: ${{ secrets.COMMAND_BOT_PAT }}
5757

5858
- name: Setup git
5959
run: |
6060
git config --local user.email "nextcloud-command@users.noreply.github.com"
6161
git config --local user.name "nextcloud-command"
6262
63-
- name: Read package.json node and npm engines version
64-
uses: skjnldsv/read-package-engines-version-actions@v3
65-
id: package-engines-versions
63+
- name: Set up node
64+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
6665
with:
67-
fallbackNode: '^20'
68-
fallbackNpm: '^10'
69-
70-
- name: Set up node ${{ steps.package-engines-versions.outputs.nodeVersion }}
71-
uses: actions/setup-node@v4
72-
with:
73-
node-version: ${{ steps.package-engines-versions.outputs.nodeVersion }}
74-
cache: npm
75-
76-
- name: Set up npm ${{ steps.package-engines-versions.outputs.npmVersion }}
77-
run: npm i -g npm@"${{ steps.package-engines-versions.outputs.npmVersion }}"
66+
node-version-file: package.json
7867

7968
- name: Install dependencies & build l10n
8069
run: |
@@ -85,7 +74,7 @@ jobs:
8574
if: ${{ needs.init.outputs.arg1 != 'fixup' && needs.init.outputs.arg1 != 'amend' }}
8675
run: |
8776
git add .
88-
git commit --signoff -m 'Updating l10n asset'
77+
git commit --signoff -m 'chore(l10n): extract new translations'
8978
git push origin ${{ needs.init.outputs.head_ref }}
9079
9180
- name: Commit and push fixup
@@ -103,7 +92,7 @@ jobs:
10392
git push --force origin ${{ needs.init.outputs.head_ref }}
10493
10594
- name: Add reaction on failure
106-
uses: peter-evans/create-or-update-comment@v4
95+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
10796
if: failure()
10897
with:
10998
token: ${{ secrets.COMMAND_BOT_PAT }}

.github/workflows/dependabot-approve-merge.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/documentation.yml

Lines changed: 4 additions & 21 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
@@ -22,32 +22,15 @@ jobs:
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
3326
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
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
39-
id: versions
30+
- name: Set up node
31+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4032
with:
41-
fallbackNode: '^20'
42-
fallbackNpm: '^10'
43-
44-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
45-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
46-
with:
47-
node-version: ${{ steps.versions.outputs.nodeVersion }}
48-
49-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
50-
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
33+
node-version-file: 'package.json'
5134

5235
- name: Install dependencies & build
5336
env:

.github/workflows/lint-stylelint.yml

Lines changed: 4 additions & 14 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
@@ -29,20 +29,10 @@ jobs:
2929
with:
3030
persist-credentials: false
3131

32-
- name: Read package.json node and npm engines version
33-
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
34-
id: versions
32+
- name: Set up node
33+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3534
with:
36-
fallbackNode: '^20'
37-
fallbackNpm: '^10'
38-
39-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
40-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
41-
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 }}'
35+
node-version-file: 'package.json'
4636

4737
- name: Install dependencies
4838
env:

.github/workflows/node-test.yml

Lines changed: 6 additions & 60 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,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
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
69-
id: versions
70-
with:
71-
fallbackNode: '^20'
72-
fallbackNpm: '^10'
73-
74-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
75-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
37+
- name: Set up node
38+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
7639
with:
77-
node-version: ${{ steps.versions.outputs.nodeVersion }}
78-
79-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
80-
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
40+
node-version-file: 'package.json'
8141

8242
- name: Install dependencies & build
8343
env:
@@ -93,20 +53,6 @@ jobs:
9353
run: npm run test:coverage --if-present
9454

9555
- name: Collect coverage
96-
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2
56+
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
9757
with:
9858
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

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

Lines changed: 6 additions & 16 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
@@ -37,24 +37,14 @@ jobs:
3737
ref: ${{ matrix.branches }}
3838
continue-on-error: true
3939

40-
- name: Read package.json node and npm engines version
41-
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
42-
id: versions
40+
- name: Set up node
41+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4342
with:
44-
fallbackNode: '^20'
45-
fallbackNpm: '^10'
46-
47-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
48-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
49-
with:
50-
node-version: ${{ steps.versions.outputs.nodeVersion }}
51-
52-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
53-
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
43+
node-version-file: 'package.json'
5444

5545
- name: Fix npm audit
5646
id: npm-audit
57-
uses: nextcloud-libraries/npm-audit-action@2a60bd2e79cc77f2cc4d9a3fe40f1a69896f3a87 # v0.1.0
47+
uses: nextcloud-libraries/npm-audit-action@1b1728b2b4a7a78d69de65608efcf4db0e3e42d0 # v0.2.0
5848

5949
- name: Run npm ci and npm run build
6050
if: steps.checkout.outcome == 'success'
@@ -66,7 +56,7 @@ jobs:
6656
6757
- name: Create Pull Request
6858
if: steps.checkout.outcome == 'success'
69-
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
59+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
7060
with:
7161
token: ${{ secrets.COMMAND_BOT_PAT }}
7262
commit-message: 'fix(deps): Fix npm audit'

.github/workflows/npm-publish.yml

Lines changed: 8 additions & 22 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
@@ -14,40 +14,26 @@ on:
1414

1515
permissions:
1616
contents: read
17+
packages: write
1718

1819
jobs:
1920
publish:
2021
runs-on: ubuntu-latest
2122

2223
name: Build and publish to npm
23-
permissions:
24-
packages: write
24+
env:
25+
RELEASE_GROUP: ${{ (contains(github.ref, 'rc') || contains(github.ref, 'beta') || contains(github.ref, 'alpha')) && 'next' || 'latest' }}
2526

2627
steps:
27-
- name: Check actor permission level
28-
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0
29-
with:
30-
require: write
31-
3228
- name: Checkout
3329
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3430
with:
3531
persist-credentials: false
3632

37-
- name: Read package.json node and npm engines version
38-
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
39-
id: versions
33+
- name: Set up node
34+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4035
with:
41-
fallbackNode: '^20'
42-
fallbackNpm: '^10'
43-
44-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
45-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
46-
with:
47-
node-version: ${{ steps.versions.outputs.nodeVersion }}
48-
49-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
50-
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
36+
node-version-file: 'package.json'
5137

5238
- name: Install dependencies & build
5339
env:
@@ -59,6 +45,6 @@ jobs:
5945
- name: Publish
6046
run: |
6147
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
62-
npm publish
48+
npm publish --tag $RELEASE_GROUP
6349
env:
6450
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)