Skip to content

Create label-community-pr.yml #28

Create label-community-pr.yml

Create label-community-pr.yml #28

name: Label community PRs
on:
pull_request:
permissions:
pull-requests: write
jobs:
check_author:
runs-on: ubuntu-latest
steps:
- name: Check PR Author Membership
id: check_membership
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set +e
gh api orgs/Kong/members --paginate -q '.[].login' | grep -q '${{ github.event.pull_request.user.login }}'
echo $?
echo "exitcode=$?" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
- name: Add Label if Author is not a member
if: steps.check_membership.outputs.exitcode == '1'
uses: christianvuerings/add-labels@v1
with:
labels: |
author/community
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}