Skip to content

Commit e12b0e1

Browse files
committed
feat: add org-wide auto-rebase workflow for PRs
1 parent 0c0c8dc commit e12b0e1

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Auto-rebase open PRs when main branch is updated
2+
# This prevents merge conflicts from piling up across PRs
3+
name: Auto Rebase PRs
4+
5+
on:
6+
# Trigger when main is updated in any repo
7+
push:
8+
branches: [main, master]
9+
# Allow manual trigger
10+
workflow_dispatch:
11+
inputs:
12+
pr_number:
13+
description: 'Specific PR number to rebase (optional)'
14+
required: false
15+
16+
jobs:
17+
rebase:
18+
runs-on: ubuntu-latest
19+
# Don't run on the .github repo itself
20+
if: github.repository != 'happyvertical/.github'
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Rebase open PRs
29+
uses: peter-evans/rebase@v3
30+
with:
31+
token: ${{ secrets.GITHUB_TOKEN }}
32+
# Only rebase PRs that are behind main
33+
rebase-all: false
34+
# Exclude draft PRs
35+
exclude-drafts: true
36+
# Exclude PRs with 'no-rebase' label
37+
exclude-labels: no-rebase

0 commit comments

Comments
 (0)