Skip to content

Commit

Permalink
chore(ci): automatically label community PRs with author/community (#…
Browse files Browse the repository at this point in the history
…11659)

Remove label from PRs that created by organization members and bots

https://konghq.atlassian.net/browse/KAG-2562
  • Loading branch information
Water-Melon authored Sep 26, 2023
1 parent 5eb4c0d commit 1c72eb3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/label-community-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
env:
GH_TOKEN: ${{ secrets.COMMUNITY_PRS_TOKEN }}
LABEL: "author/community"
BOTS: "team-gateway-bot dependabot"
BOTS: "team-gateway-bot app/dependabot"
run: |
set +e
for id in `gh pr list -S 'draft:false' -s 'open'|awk '{print $1}'`
do
name=`gh pr view $id --json author -q '.author.login'`
gh api orgs/Kong/members --paginate -q '.[].login'|grep -q "^${name}$"
if [[ $? -ne 0 && ! "${BOTS[@]}" =~ $name ]]; then
ret=`gh api orgs/Kong/members --paginate -q '.[].login'|grep "^${name}$"`
if [[ -z $ret && ! "${BOTS[@]}" =~ $name ]]; then
gh pr edit $id --add-label "${{ env.LABEL }}"
else
gh pr edit $id --remove-label "${{ env.LABEL }}"
Expand Down

1 comment on commit 1c72eb3

@khcp-gha-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:1c72eb376d7dd896128b98da7bc3d33a09098ca6
Artifacts available https://github.com/Kong/kong/actions/runs/6315464403

Please sign in to comment.