Skip to content

Commit 5fc2aa3

Browse files
Create pr-auto-label.yml
Signed-off-by: Matty Widdop <[email protected]>
1 parent 11063a9 commit 5fc2aa3

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Automatically mark PRs to sync"
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
8+
jobs:
9+
labeler:
10+
if: github.event.pull_request.user.type != 'Bot'
11+
permissions:
12+
pull-requests: write
13+
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Add "sync" label to PR
17+
run: gh pr edit "$PR_URL" --add-label sync
18+
env:
19+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
PR_URL: ${{ github.event.pull_request.html_url }}
21+
22+
- name: Comment on PR to explain sync label
23+
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."
24+
env:
25+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
PR_URL: ${{ github.event.pull_request.html_url }}

0 commit comments

Comments
 (0)