Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: 🤖 Enable Auto-Merge

# yamllint disable-line rule:truthy
on:
pull_request: {}

permissions:
contents: read

jobs:
automerge:
name: Enable auto-merge
if: github.event_name == 'pull_request' && (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'renovate[bot]')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Enable auto-merge for PR
env:
GH_TOKEN: ${{ github.token }}
PR_URL: ${{ github.event.pull_request.html_url }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: gh pr merge --auto --merge --match-head-commit "$PR_HEAD_SHA" "$PR_URL"
17 changes: 0 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,3 @@ jobs:
name: Test suite
steps:
- run: echo Test suite completed

automerge:
name: Enable auto-merge
if: github.event_name == 'pull_request' && (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'renovate[bot]')
needs:
- tests
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Enable auto-merge for PR
env:
GH_TOKEN: ${{ github.token }}
PR_URL: ${{ github.event.pull_request.html_url }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: gh pr merge --auto --merge --match-head-commit "$PR_HEAD_SHA" "$PR_URL"
1 change: 0 additions & 1 deletion TEMPLATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ merge Dependabot and Renovate pull requests after successful CI.
| `test_repository` | empty | Optional repository checked out before tests |
| `test_commands` | `[]` | Shell commands for the `Test image` step |
| `post_test_commands` | `[]` | Shell commands for diagnostics after tests |
| `automerge` | `true` | Enables auto-merge for Dependabot and Renovate pull requests |

Example:

Expand Down
1 change: 0 additions & 1 deletion config_defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ renovate.json:
test_repository:
test_commands: []
post_test_commands: []
automerge: true
.github/workflows/security_scanning.yml:
scan_job_name: Scan ci container
fail_build: false
Expand Down
28 changes: 28 additions & 0 deletions moduleroot/.github/workflows/automerge.yml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

name: 🤖 Enable Auto-Merge

# yamllint disable-line rule:truthy
on:
pull_request: {}

permissions:
contents: read

jobs:
automerge:
name: Enable auto-merge
if: github.event_name == 'pull_request' && (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'renovate[bot]')
Comment thread
rwaffen marked this conversation as resolved.
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Enable auto-merge for PR
env:
GH_TOKEN: ${{ github.token }}
PR_URL: ${{ github.event.pull_request.html_url }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: gh pr merge --auto --merge --match-head-commit "$PR_HEAD_SHA" "$PR_URL"
19 changes: 0 additions & 19 deletions moduleroot/.github/workflows/ci.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,3 @@ jobs:
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
<%- if @configs['automerge'] -%>

automerge:
name: Enable auto-merge
if: github.event_name == 'pull_request' && (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'renovate[bot]')
needs:
- tests
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Enable auto-merge for PR
env:
GH_TOKEN: ${{ github.token }}
PR_URL: ${{ github.event.pull_request.html_url }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: gh pr merge --auto --merge --match-head-commit "$PR_HEAD_SHA" "$PR_URL"
<%- end -%>