Skip to content

Commit

Permalink
Merge pull request #68 from Bullrich/auto-merge-bot
Browse files Browse the repository at this point in the history
added auto-merge and up-to-date GitHub actions
  • Loading branch information
bkchr committed Jun 29, 2024
2 parents b59a305 + 109b6c5 commit a4e0335
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Auto Merge Bot

on:
# GitHub considers PRs as issues
issue_comment:
types: [created]

jobs:
set-auto-merge:
runs-on: ubuntu-latest
environment: master
timeout-minutes: 10
# Important! This forces the job to run only on comments on Pull Requests that starts with '/merge'
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/merge') }}
steps:
- name: Get the GitHub handle of the fellows
uses: paritytech/get-fellows-action@v1.1.3
id: fellows
- name: Generate a token
id: merge_token
uses: actions/create-github-app-token@v1.8.1
with:
app-id: ${{ secrets.MERGE_APP_ID }}
private-key: ${{ secrets.MERGE_APP_KEY }}
- name: Set auto merge
uses: paritytech/auto-merge-bot@v1.0.1
with:
GITHUB_TOKEN: ${{ steps.merge_token.outputs.token }}
MERGE_METHOD: "SQUASH"
ALLOWLIST: ${{ steps.fellows.outputs.github-handles }}
23 changes: 23 additions & 0 deletions .github/workflows/up-to-date.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Keep PR up to date

on:
push:
branches:
- main

jobs:
updatePullRequests:
name: Keep PRs up to date
runs-on: ubuntu-latest
environment: master
steps:
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.MERGE_APP_ID }}
private-key: ${{ secrets.MERGE_APP_KEY }}
- name: Update all the PRs
uses: paritytech/up-to-date-action@v0.2.1
with:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}

0 comments on commit a4e0335

Please sign in to comment.