Skip to content

Commit ae2aa7a

Browse files
committed
Auto-label incoming PRs as not-actionable
1 parent d56e163 commit ae2aa7a

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: label-incoming-prs
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
7+
jobs:
8+
label-incoming-prs:
9+
name: Label incoming PRs
10+
runs-on: ubuntu-latest
11+
permissions:
12+
pull-requests: write
13+
steps:
14+
- name: Add not-actionable label
15+
run: |
16+
set -e # Exit if one of commands exit with non-zero exit code
17+
set -u # Treat unset variables and parameters other than the special parameters ‘@’ or ‘*’ as an error
18+
set -o pipefail # Any command failed in the pipe fails the whole pipe
19+
20+
author="$(gh pr view "$PR" --json author --jq '.author.login')"
21+
22+
label() {
23+
gh pr edit "$PR" --add-label not-actionable
24+
}
25+
26+
test "$author" = nikitabobko || test "$author" = mobile-ar || test "$author" = rickyz || label
27+
env:
28+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
GH_REPO: ${{ github.repository }}
30+
PR: ${{ github.event.number }}

0 commit comments

Comments
 (0)