Skip to content

Commit 7987401

Browse files
Create auto-label.yaml (#6)
Signed-off-by: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Co-authored-by: CSS <66796201+cssbhamdev@users.noreply.github.com>
1 parent 22fd296 commit 7987401

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

.github/workflows/auto-label.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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 --repo "$PR_REPO"
18+
env:
19+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
PR_URL: ${{ github.event.pull_request.html_url }}
21+
PR_REPO: ${{ github.repository }}
22+
23+
- name: Comment on PR to explain sync label
24+
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"
25+
env:
26+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
PR_URL: ${{ github.event.pull_request.html_url }}
28+
PR_REPO: ${{ github.repository }}

0 commit comments

Comments
 (0)