Skip to content
Merged
30 changes: 30 additions & 0 deletions .github/workflows/pr-auto-label.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Automatically mark PRs to sync"

on:
pull_request:
types:
- opened

jobs:
labeler:
if: github.event.pull_request.user.type != 'Bot'
permissions:
pull-requests: write

runs-on: ubuntu-latest
steps:
- name: Add "sync" label to PR
run: gh pr edit "$PR_URL" --add-label sync --repo "$PR_REPO"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
PR_REPO: ${{ github.repository }}

- name: Comment on PR to explain sync label
run: gh pr comment "$PR_URL" --body "This pull request has been marked to **automatically
sync** to its base branch. You can **disable** this behavior by removing the `sync`
label." --repo "$PR_REPO"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
PR_REPO: ${{ github.repository }}
23 changes: 23 additions & 0 deletions .github/workflows/pr-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Automatically enable auto-merge on PRs"

on:
pull_request_target:
types:
- opened
- ready_for_review
branches:
- main

jobs:
enable-automerge:
if: github.event.pull_request.draft == false
permissions:
pull-requests: write

runs-on: ubuntu-latest
steps:
- name: Enable auto-merge for the PR
run: gh pr merge "$PR_URL" --auto --squash
env:
GH_TOKEN: ${{ secrets.PR_AUTO_UPDATE_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
19 changes: 19 additions & 0 deletions .github/workflows/pr-auto-updater.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: pr-auto-update
on:
push: {}

jobs:
pr-auto-update:
name: Automatic PR Updater
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: CSSUoB/[email protected]
env:
GITHUB_TOKEN: '${{ secrets.PR_AUTO_UPDATE_TOKEN }}'
PR_FILTER: 'labelled'
PR_LABELS: 'sync'
MERGE_CONFLICT_ACTION: 'label'
MERGE_CONFLICT_LABEL: 'conflict'