Commit c3b09bf 1 parent c8003e1 commit c3b09bf Copy full SHA for c3b09bf
File tree 13 files changed +140
-0
lines changed
13 files changed +140
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : approve command
2
+ on :
3
+ repository_dispatch :
4
+ types : [approve-command]
5
+ jobs :
6
+ approve :
7
+ runs-on : ubuntu-latest
8
+ steps :
9
+ - uses : mkimuram/test-gha/plugins/approve@main
Original file line number Diff line number Diff line change
1
+ name : lgtm command
2
+ on :
3
+ repository_dispatch :
4
+ types : [lgtm-command]
5
+ jobs :
6
+ lgtm :
7
+ runs-on : ubuntu-latest
8
+ steps :
9
+ - uses : mkimuram/test-gha/plugins/lgtm@main
Original file line number Diff line number Diff line change
1
+ name : remove-approve command
2
+ on :
3
+ repository_dispatch :
4
+ types : [remove-approve-command]
5
+ jobs :
6
+ remove-approve :
7
+ runs-on : ubuntu-latest
8
+ steps :
9
+ - uses : mkimuram/test-gha/plugins/remove-approve@main
Original file line number Diff line number Diff line change
1
+ name : remove-lgtm command
2
+ on :
3
+ repository_dispatch :
4
+ types : [remove-lgtm-command]
5
+ jobs :
6
+ remove-lgtm :
7
+ runs-on : ubuntu-latest
8
+ steps :
9
+ - uses : mkimuram/test-gha/plugins/remove-lgtm@main
Original file line number Diff line number Diff line change 18
18
unassign
19
19
kind
20
20
remove-kind
21
+ lgtm
22
+ remove-lgtm
23
+ approve
24
+ remove-approve
21
25
retest
22
26
meow
23
27
woof
Original file line number Diff line number Diff line change
1
+ name : ' Approve'
2
+ description : ' Approves a pull request'
3
+ runs :
4
+ using : " composite"
5
+ steps :
6
+ - name : Approves a pull request
7
+ shell : bash
8
+ run : |
9
+ label="approved"
10
+ # approve is only for pr
11
+ [ -n "${PR_NUM}" ] || false
12
+ # TODO: Check if actor has right to approve
13
+ # If no args add approved label
14
+ if [ -z "${ARGS}" ];then
15
+ echo "{\"labels\":[\"${label}\"]}" | \
16
+ gh api repos/${REPO}/issues/${ISSUE_NUM}/labels -X POST --input -
17
+ # If args is cancel remove approved label
18
+ elif [[ "${ARGS}" == "cancel" ]];then
19
+ gh api repos/${REPO}/issues/${ISSUE_NUM}/labels/${label} -X DELETE
20
+ fi
21
+ env :
22
+ REPO : ${{ github.repository }}
23
+ ISSUE_NUM : ${{ github.event.client_payload.github.payload.issue.number }}
24
+ PR_NUM : ${{ github.event.client_payload.pull_request.number }}
25
+ ARGS : ${{ github.event.client_payload.slash_command.args.unnamed.all }}
26
+ GITHUB_TOKEN : ${{ github.token }}
Original file line number Diff line number Diff line change
1
+ | `/lgtm` | `/lgtm [cancel] ` | Adds or removes the 'lgtm' label which is typically used to gate merging. |
Original file line number Diff line number Diff line change
1
+ name : ' Lgtm'
2
+ description : ' Add lgtm label to pr'
3
+ runs :
4
+ using : " composite"
5
+ steps :
6
+ - name : Add lgtm label to pr
7
+ shell : bash
8
+ run : |
9
+ label="lgtm"
10
+ # lgtm is only for pr
11
+ [ -n "${PR_NUM}" ] || false
12
+ # TODO: Check if actor has right to lgtm
13
+ # If no args add lgtm label
14
+ if [ -z "${ARGS}" ];then
15
+ echo "{\"labels\":[\"${label}\"]}" | \
16
+ gh api repos/${REPO}/issues/${ISSUE_NUM}/labels -X POST --input -
17
+ # If args is cancel remove lgtm label
18
+ elif [[ "${ARGS}" == "cancel" ]];then
19
+ gh api repos/${REPO}/issues/${ISSUE_NUM}/labels/${label} -X DELETE
20
+ fi
21
+ env :
22
+ REPO : ${{ github.repository }}
23
+ ISSUE_NUM : ${{ github.event.client_payload.github.payload.issue.number }}
24
+ PR_NUM : ${{ github.event.client_payload.pull_request.number }}
25
+ ARGS : ${{ github.event.client_payload.slash_command.args.unnamed.all }}
26
+ GITHUB_TOKEN : ${{ github.token }}
Original file line number Diff line number Diff line change
1
+ | `/lgtm` | `/lgtm [cancel] ` | Adds or removes the 'lgtm' label which is typically used to gate merging. |
Original file line number Diff line number Diff line change
1
+ name : ' Remove approve'
2
+ description : ' Remove approved label from pr'
3
+ runs :
4
+ using : " composite"
5
+ steps :
6
+ - name : Remove approved label from pr
7
+ shell : bash
8
+ run : |
9
+ label="approved"
10
+ # remove-approve is only for pr
11
+ [ -n "${PR_NUM}" ] || false
12
+ # TODO: Check if actor has right to remove-approve
13
+ # If no args remove approved label
14
+ if [ -z "${ARGS}" ];then
15
+ gh api repos/${REPO}/issues/${ISSUE_NUM}/labels/${label} -X DELETE
16
+ fi
17
+ env :
18
+ REPO : ${{ github.repository }}
19
+ ISSUE_NUM : ${{ github.event.client_payload.github.payload.issue.number }}
20
+ PR_NUM : ${{ github.event.client_payload.pull_request.number }}
21
+ ARGS : ${{ github.event.client_payload.slash_command.args.unnamed.all }}
22
+ GITHUB_TOKEN : ${{ github.token }}
Original file line number Diff line number Diff line change
1
+ | `/remove-approve` | `/remove-approve ` | Removes the 'approved' label which is typically used to gate merging. |
Original file line number Diff line number Diff line change
1
+ name : ' Remove lgtm'
2
+ description : ' Remove lgtm label from pr'
3
+ runs :
4
+ using : " composite"
5
+ steps :
6
+ - name : Remove lgtm label from pr
7
+ shell : bash
8
+ run : |
9
+ label="lgtm"
10
+ # remove-lgtm is only for pr
11
+ [ -n "${PR_NUM}" ] || false
12
+ # TODO: Check if actor has right to remove-lgtm
13
+ # If no args remove lgtm label
14
+ if [ -z "${ARGS}" ];then
15
+ gh api repos/${REPO}/issues/${ISSUE_NUM}/labels/${label} -X DELETE
16
+ fi
17
+ env :
18
+ REPO : ${{ github.repository }}
19
+ ISSUE_NUM : ${{ github.event.client_payload.github.payload.issue.number }}
20
+ PR_NUM : ${{ github.event.client_payload.pull_request.number }}
21
+ ARGS : ${{ github.event.client_payload.slash_command.args.unnamed.all }}
22
+ GITHUB_TOKEN : ${{ github.token }}
Original file line number Diff line number Diff line change
1
+ | `/remove-lgtm` | `/remove-lgtm ` | Removes the 'lgtm' label which is typically used to gate merging. |
You can’t perform that action at this time.
0 commit comments