Skip to content

Commit

Permalink
added auto-merge and up-to-date GitHub actions
Browse files Browse the repository at this point in the history
Once #67 is complete, we can enable this bots

They **will not work until they are merged**.

This enabled [auto-merge-bot](https://github.com/paritytech/auto-merge-bot) so we can enable auto merge running the `/merge` command and [up-to-date action](https://github.com/paritytech/up-to-date-action) so we can keep all the PRs up to date.
  • Loading branch information
Bullrich committed Jun 28, 2024
1 parent 9b08334 commit 7c86b7e
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 7c86b7e

Please sign in to comment.