File tree 2 files changed +55
-0
lines changed
2 files changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Add labels to PR
2
+
3
+ on :
4
+ pull_request :
5
+ types :
6
+ - opened
7
+ - reopened
8
+ - synchronize
9
+
10
+ permissions :
11
+ actions : read
12
+ contents : read
13
+ pull-requests : write
14
+
15
+ jobs :
16
+ main :
17
+ runs-on : ubuntu-latest
18
+ steps :
19
+ - uses : actions/checkout@v4
20
+ with :
21
+ fetch-depth : 0
22
+
23
+ - run : ./scripts/add_labels_to_pr.sh
24
+ env :
25
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
26
+ GH_REPO : ${{ github.repository }}
27
+ PR_NUMBER : ${{ github.event.pull_request.number }}
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ diff_result=$( git diff --name-only origin/main..HEAD)
4
+
5
+ if [[ " ${diff_result[*]} " =~ packages/core/* ]]; then
6
+ echo " Change found in packages/core, adding label for core"
7
+ gh pr edit $PR_NUMBER --add-label " core ⚙"
8
+ fi
9
+
10
+ if [[ " ${diff_result[*]} " =~ packages/auto-complete/* ]]; then
11
+ echo " Change found in packages/auto-complete, adding label for auto-complete"
12
+ gh pr edit $PR_NUMBER --add-label " auto-complete 🔮"
13
+ fi
14
+
15
+ if [[ " ${diff_result[*]} " =~ packages/create-app/* ]]; then
16
+ echo " Change found in packages/create-app, adding label for create-app"
17
+ gh pr edit $PR_NUMBER --add-label " create-app 📂"
18
+ fi
19
+
20
+ if [[ " ${diff_result[*]} " =~ docs/* ]]; then
21
+ echo " Change found in docs, adding label for documentation"
22
+ gh pr edit $PR_NUMBER --add-label " documentation 📝"
23
+ fi
24
+
25
+ if [[ " ${diff_result[*]} " =~ .github/workflows/* ]]; then
26
+ echo " Change found in .github/workflows, adding label for ci"
27
+ gh pr edit $PR_NUMBER --add-label " ci 🤖"
28
+ fi
You can’t perform that action at this time.
0 commit comments