|
6 | 6 | # SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors |
7 | 7 | # SPDX-License-Identifier: MIT |
8 | 8 |
|
9 | | -name: Auto approve nextcloud/ocp |
| 9 | +# TODO: Remove this after a grace period of 6 months to give everyone the chance to remove the workflow |
| 10 | +# TODO: To be removed mid 2027. |
| 11 | +name: No-op please remove this workflow |
10 | 12 |
|
11 | | -on: |
12 | | - pull_request_target: # zizmor: ignore[dangerous-triggers] |
13 | | - branches: |
14 | | - - main |
15 | | - - master |
16 | | - - stable* |
| 13 | +on: pull_request |
17 | 14 |
|
18 | 15 | permissions: |
19 | | - contents: read |
| 16 | + contents: none |
20 | 17 |
|
21 | 18 | concurrency: |
22 | 19 | group: update-nextcloud-ocp-approve-merge-${{ github.head_ref || github.run_id }} |
23 | 20 | cancel-in-progress: true |
24 | 21 |
|
25 | 22 | jobs: |
26 | 23 | auto-approve-merge: |
27 | | - if: github.actor == 'nextcloud-command' |
28 | 24 | runs-on: ubuntu-latest-low |
29 | | - permissions: |
30 | | - # for auto-approve-action to approve PRs |
31 | | - pull-requests: write |
32 | | - # for alexwilson/enable-github-automerge-action to approve PRs |
33 | | - contents: write |
| 25 | + if: always() |
34 | 26 |
|
35 | | - steps: |
36 | | - - name: Disabled on forks |
37 | | - if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} |
38 | | - run: | |
39 | | - echo 'Can not approve PRs from forks' |
40 | | - exit 1 |
41 | | -
|
42 | | - - uses: mdecoleman/pr-branch-name@55795d86b4566d300d237883103f052125cc7508 # v3.0.0 |
43 | | - id: branchname |
44 | | - with: |
45 | | - repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 27 | + # This is the summary, we just avoid to rename it so that branch protection rules still match |
| 28 | + name: auto-approve-merge |
46 | 29 |
|
47 | | - - name: GitHub actions bot approve |
48 | | - if: startsWith(steps.branchname.outputs.branch, 'automated/noid/') && endsWith(steps.branchname.outputs.branch, 'update-nextcloud-ocp') |
49 | | - run: gh pr review --approve "$PR_URL" |
50 | | - env: |
51 | | - PR_URL: ${{ github.event.pull_request.html_url }} |
52 | | - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
53 | | - |
54 | | - # Enable GitHub auto merge |
55 | | - - name: Auto merge |
56 | | - uses: alexwilson/enable-github-automerge-action@2c32e18a76e0726ffe7a573bfff2d42a20885126 # 3.0.0 |
57 | | - if: startsWith(steps.branchname.outputs.branch, 'automated/noid/') && endsWith(steps.branchname.outputs.branch, 'update-nextcloud-ocp') |
58 | | - with: |
59 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
| 30 | + steps: |
| 31 | + - name: No-op please remove this workflow |
| 32 | + run: echo "Approve and auto-merge has been folded into update-nextcloud-ocp.yml / update-nextcloud-ocp-matrix.yml, please remove this file"; exit 1; |
0 commit comments