-
Notifications
You must be signed in to change notification settings - Fork 3
28 lines (24 loc) · 934 Bytes
/
pr-auto-label.yml
File metadata and controls
28 lines (24 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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 }}