-
-
Notifications
You must be signed in to change notification settings - Fork 481
39 lines (38 loc) · 1.33 KB
/
pr-labeler.yml
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
29
30
31
32
33
34
35
36
37
38
39
# This action automatically labels Pull-Requests
# based on files edited and no of lines changed.
name: Size Labeler/Checker
on:
pull_request_target:
types:
- opened
- reopened
- synchronize
- ready_for_review
- review_requested
- edited
jobs:
label-changes:
if: vars.SMALL_THRESHOLD && vars.MODERATE_THRESHOLD && vars.LARGE_THRESHOLD && github.event.pull_request.draft == false
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Add labels based on size
run: |
git fetch origin $BASE_SHA
chmod a+x .github/workflows/set_labels_by_changes.sh
.github/workflows/set_labels_by_changes.sh
env:
BASE_SHA: ${{ github.base_ref }}
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number}}
SMALL_THRESHOLD: ${{ vars.SMALL_THRESHOLD }}
MODERATE_THRESHOLD: ${{ vars.MODERATE_THRESHOLD }}
LARGE_THRESHOLD: ${{ vars.LARGE_THRESHOLD }}