Skip to content

Commit

Permalink
CI: Auto-merge Sourcery AI bot PRs (#9)
Browse files Browse the repository at this point in the history
Add a GitHub Actions workflow to automatically merge pull requests from the Sourcery AI bot.

New Features:
- Introduce automated merging of Sourcery AI bot PRs using GitHub Actions.

CI:
- Set up a workflow to automatically merge pull requests opened by the `sourcery-ai[bot]` user. The workflow uses the `gh` CLI to merge the PR with the squash strategy, auto-merge, and delete the branch after merging.

Resolves #6

Co-authored-by: sourcery-ai[bot] <sourcery-ai[bot]@users.noreply.github.com>
  • Loading branch information
sourcery-ai[bot] and sourcery-ai[bot] authored Dec 24, 2024
1 parent a5f742b commit 6835738
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/merge-sourcery-ai-bot-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Auto-merge Sourcery AI Bot PRs

on:
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: write

env:
GH_TOKEN: ${{ secrets.USER_TOKEN }}

jobs:
merge-sourcery-pr:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'sourcery-ai[bot]'
steps:
- name: Merge Pull Request
run: |
gh pr merge "${{ github.event.pull_request.number }}" \
--squash \
--auto \
--delete-branch \
--repo "${{ github.repository }}"

0 comments on commit 6835738

Please sign in to comment.