Skip to content

Commit 0bb3bc8

Browse files
Merge pull request #3402 from nextcloud/automated/noid/stable32-update-workflows
[stable32] ci(actions): Update workflow templates from organization template repository
2 parents 11a5a9c + 869eedf commit 0bb3bc8

4 files changed

Lines changed: 50 additions & 67 deletions

File tree

‎.github/actions-lock.txt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dc0ae733f35c60274937c2647c027d46 lint-eslint.yml
1313
300be6a756abda800e40850918f2d964 lint-php.yml
1414
ab3a506506b1d7c1cea9593ecfd84366 lint-stylelint.yml
1515
03759c9dc0fa748cb927b9f9cadf2925 node.yml
16-
0dc931ec237a235370e224282608b20e npm-audit-fix.yml
16+
ffbfc28e30ea82e6334314aa8f703b67 npm-audit-fix.yml
1717
b45e44d9ffe39586b38b6a925c1a9740 openapi.yml
1818
3cacf28a710b387e83d3858af40b7ffe phpunit-mysql.yml
1919
f89c18551d6a29af9bca63a0fd30a039 phpunit-oci.yml
@@ -22,7 +22,7 @@ ba5a538fea1a9e53dfcbeb53b83ea6fa phpunit-sqlite.yml
2222
aaa395a26591445ccf4c8196d7f01ee7 pr-feedback.yml
2323
4f1080b33778a956a08efc7a41a11994 psalm.yml
2424
2dbec18233063b42f4d8e03bbb43671c reuse.yml
25-
a3440826636c0fd7c2d20b1de50363da update-nextcloud-ocp-approve-merge.yml
26-
1919e2ff468e875aeeae5fd088d4ce1f update-nextcloud-ocp.yml
25+
abcb8206c3f6c5a9dc86cccf57846bfc update-nextcloud-ocp-approve-merge.yml
26+
f951ce2c95c9fcf7f4122b6f4f44618d update-nextcloud-ocp.yml
2727
22604c31b526de270a080eb19967a638 update-stable-titles.yml
2828
ab958fa2b07234fceab6b6d836fb7f19 npm-build.yml

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

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@ on:
1515
- cron: '30 2 * * 0'
1616

1717
permissions:
18-
contents: read
18+
contents: write
19+
pull-requests: write
1920

2021
jobs:
2122
build:
2223
runs-on: ubuntu-latest
2324

25+
env:
26+
# env variable for maintainers: 'false' disables auto-merge for these pull requests
27+
AUTOMERGE: true
28+
2429
strategy:
2530
fail-fast: false
2631
matrix:
@@ -29,7 +34,6 @@ jobs:
2934
- 'stable35'
3035
- 'stable34'
3136
- 'stable33'
32-
- 'stable32'
3337

3438
name: npm-audit-fix-${{ matrix.branches }}
3539

@@ -70,6 +74,7 @@ jobs:
7074
npm run build --if-present
7175
7276
- name: Create Pull Request
77+
id: create-pull-request
7378
if: steps.checkout.outcome == 'success'
7479
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
7580
with:
@@ -84,3 +89,19 @@ jobs:
8489
labels: |
8590
dependencies
8691
3. to review
92+
93+
# Approve using the default GITHUB_TOKEN, as the PR itself was created
94+
# using COMMAND_BOT_PAT and GitHub does not allow an account to approve its own PR
95+
- name: GitHub actions bot approve
96+
if: steps.create-pull-request.outputs.pull-request-operation != 'none'
97+
run: gh pr review --approve "$PR_URL"
98+
env:
99+
PR_URL: ${{ steps.create-pull-request.outputs.pull-request-url }}
100+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101+
102+
- name: Enable auto merge
103+
if: steps.create-pull-request.outputs.pull-request-operation != 'none' && fromJSON(env.AUTOMERGE)
104+
uses: peter-evans/enable-pull-request-automerge@a660677d5469627102a1c1e11409dd063606628d # v3.0.0
105+
with:
106+
token: ${{ secrets.GITHUB_TOKEN }}
107+
pull-request-number: ${{ steps.create-pull-request.outputs.pull-request-number }}

‎.github/workflows/update-nextcloud-ocp-approve-merge.yml‎

Lines changed: 0 additions & 59 deletions
This file was deleted.

‎.github/workflows/update-nextcloud-ocp.yml‎

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ on:
1414
- cron: "5 2 * * *"
1515

1616
permissions:
17-
contents: read
17+
contents: write
1818
issues: write
19+
pull-requests: write
1920

2021
jobs:
2122
update-nextcloud-ocp:
@@ -24,6 +25,10 @@ jobs:
2425
# Only allowed to be run on nextcloud repositories
2526
if: ${{ github.repository_owner == 'nextcloud' }}
2627

28+
env:
29+
# env variable for maintainers: 'false' disables auto-merge for these pull requests
30+
AUTOMERGE: true
31+
2732
strategy:
2833
fail-fast: false
2934
matrix:
@@ -32,7 +37,6 @@ jobs:
3237
- 'stable35'
3338
- 'stable34'
3439
- 'stable33'
35-
- 'stable32'
3640

3741
name: update-nextcloud-ocp-${{ matrix.branches }}
3842

@@ -101,6 +105,7 @@ jobs:
101105
body: 'Please check the output of the GitHub action and manually resolve the issues<br>${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}<br>${{ steps.codeowners.outputs.codeowners }}'
102106

103107
- name: Create Pull Request
108+
id: create-pull-request
104109
if: steps.checkout.outcome == 'success'
105110
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
106111
with:
@@ -111,7 +116,7 @@ jobs:
111116
signoff: true
112117
branch: 'automated/noid/${{ matrix.branches }}-update-nextcloud-ocp'
113118
title: '[${{ matrix.branches }}] Update nextcloud/ocp dependency'
114-
add-path: |
119+
add-paths: |
115120
composer.json
116121
composer.lock
117122
vendor-bin/nextcloud-ocp/composer.json
@@ -121,3 +126,19 @@ jobs:
121126
labels: |
122127
dependencies
123128
3. to review
129+
130+
# Approve using the default GITHUB_TOKEN, as the PR itself was created
131+
# using COMMAND_BOT_PAT and GitHub does not allow an account to approve its own PR
132+
- name: GitHub actions bot approve
133+
if: steps.create-pull-request.outputs.pull-request-operation != 'none'
134+
run: gh pr review --approve "$PR_URL"
135+
env:
136+
PR_URL: ${{ steps.create-pull-request.outputs.pull-request-url }}
137+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
138+
139+
- name: Enable auto merge
140+
if: steps.create-pull-request.outputs.pull-request-operation != 'none' && fromJSON(env.AUTOMERGE)
141+
uses: peter-evans/enable-pull-request-automerge@a660677d5469627102a1c1e11409dd063606628d # v3.0.0
142+
with:
143+
token: ${{ secrets.GITHUB_TOKEN }}
144+
pull-request-number: ${{ steps.create-pull-request.outputs.pull-request-number }}

0 commit comments

Comments
 (0)