Skip to content

Commit b39c838

Browse files
authored
Merge pull request #1211 from nextcloud-libraries/chore/update-workflows
ci: update workflows from organization
2 parents 6fcda1c + 1acabaa commit b39c838

File tree

9 files changed

+113
-29
lines changed

9 files changed

+113
-29
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
token: ${{ secrets.COMMAND_BOT_PAT }}
3232
repository: ${{ github.event.repository.full_name }}
3333
comment-id: ${{ github.event.comment.id }}
34-
reaction-type: "+1"
34+
reactions: '+1'
3535

3636
- name: Parse command
3737
uses: skjnldsv/parse-command-comment@5c955203c52424151e6d0e58fb9de8a9f6a605a1 # v3.1.0
@@ -60,10 +60,17 @@ jobs:
6060
git config --local user.email "[email protected]"
6161
git config --local user.name "nextcloud-command"
6262
63+
- name: Read package.json
64+
uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0
65+
id: versions
66+
6367
- name: Set up node
6468
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
6569
with:
66-
node-version-file: package.json
70+
node-version: ${{ steps.versions.outputs.node-version }}
71+
72+
- name: Set up npm
73+
run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}'
6774

6875
- name: Install dependencies & build l10n
6976
run: |

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

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# 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: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,17 @@ jobs:
2727
with:
2828
persist-credentials: false
2929

30+
- name: Read package.json
31+
uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0
32+
id: versions
33+
3034
- name: Set up node
3135
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
3236
with:
33-
node-version-file: 'package.json'
37+
node-version: ${{ steps.versions.outputs.node-version }}
38+
39+
- name: Set up npm
40+
run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}'
3441

3542
- name: Install dependencies & build
3643
env:

.github/workflows/l10n.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
1+
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
22
# SPDX-License-Identifier: MIT
3+
34
name: L10n
45
on: pull_request
6+
permissions:
7+
contents: read
58

69
jobs:
710
l10n-extract-check:
811
runs-on: ubuntu-latest
912

1013
name: Pot check
1114
steps:
12-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v3
15+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1316

14-
- name: Read package.json node and npm engines version
15-
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v2
17+
- name: Read package.json
18+
uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0
1619
id: versions
17-
with:
18-
fallbackNode: '^24'
19-
fallbackNpm: '^11.3.0'
2020

21-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
22-
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v3
21+
- name: Set up node
22+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
2323
with:
24-
node-version: ${{ steps.versions.outputs.nodeVersion }}
24+
node-version: ${{ steps.versions.outputs.node-version }}
2525

26-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
27-
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
26+
- name: Set up npm
27+
run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}'
2828

2929
- name: Install dependencies
3030
run: npm ci

.github/workflows/lint-eslint.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,17 @@ jobs:
2929
with:
3030
persist-credentials: false
3131

32+
- name: Read package.json
33+
uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0
34+
id: versions
35+
3236
- name: Set up node
3337
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
3438
with:
35-
node-version-file: 'package.json'
39+
node-version: ${{ steps.versions.outputs.node-version }}
40+
41+
- name: Set up npm
42+
run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}'
3643

3744
- name: Install dependencies
3845
env:

.github/workflows/node-test.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,17 @@ jobs:
3434
with:
3535
persist-credentials: false
3636

37+
- name: Read package.json
38+
uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0
39+
id: versions
40+
3741
- name: Set up node
3842
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
3943
with:
40-
node-version-file: 'package.json'
44+
node-version: ${{ steps.versions.outputs.node-version }}
45+
46+
- name: Set up npm
47+
run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}'
4148

4249
- name: Install dependencies & build
4350
env:
@@ -56,3 +63,5 @@ jobs:
5663
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
5764
with:
5865
files: ./coverage/lcov.info
66+
env:
67+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/node.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,23 @@ jobs:
2828
with:
2929
persist-credentials: false
3030

31+
- name: Read package.json
32+
uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0
33+
id: versions
34+
3135
- name: Set up node
3236
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
3337
with:
34-
node-version-file: 'package.json'
38+
node-version: ${{ steps.versions.outputs.node-version }}
39+
40+
- name: Set up npm
41+
run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}'
42+
43+
- name: Validate package-lock.json # See https://github.com/npm/cli/issues/4460
44+
run: |
45+
46+
npm-package-lock-add-resolved
47+
git --no-pager diff --exit-code
3548
3649
- name: Install dependencies & build
3750
env:

.github/workflows/npm-publish.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,17 @@ jobs:
2727
with:
2828
persist-credentials: false
2929

30+
- name: Read package.json
31+
uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0
32+
id: versions
33+
3034
- name: Set up node
3135
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
3236
with:
33-
node-version-file: 'package.json'
37+
node-version: ${{ steps.versions.outputs.node-version }}
38+
39+
- name: Set up npm
40+
run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}'
3441

3542
- name: Check tag matches package.json
3643
run: |

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

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,42 @@
11
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
22
# SPDX-License-Identifier: MIT
3+
34
name: Transifex
4-
on: pull_request
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
- master
11+
- next
12+
- stable*
13+
14+
permissions:
15+
contents: read
16+
17+
concurrency:
18+
group: transifex-approve-merge-${{ github.head_ref || github.run_id }}
19+
cancel-in-progress: true
520

621
jobs:
722
auto-approve-merge:
823
if: github.event.pull_request.user.login == 'transifex-integration[bot]'
924
runs-on: ubuntu-latest
25+
permissions:
26+
# for hmarr/auto-approve-action to approve PRs
27+
pull-requests: write
1028

1129
steps:
12-
- uses: hmarr/auto-approve-action@v3
30+
- name: Disabled on forks
31+
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
32+
run: |
33+
echo 'Can not approve PRs from forks'
34+
exit 1
35+
36+
# GitHub actions bot approve
37+
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4
1338
with:
14-
github-token: ${{ secrets.COMMAND_BOT_PAT }}
39+
github-token: ${{ secrets.GITHUB_TOKEN }}
1540

1641
- uses: pascalgn/[email protected]
1742
env:

0 commit comments

Comments
 (0)