Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #11486

Closed
wants to merge 2 commits into from
Closed

Test #11486

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/label-community-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Label community PRs

on:
pull_request:
types:
- opened

jobs:
check_author:
runs-on: ubuntu-latest

steps:
- name: Check PR Author Membership
id: check_membership
uses: octokit/[email protected]
with:
route: GET /orgs/Kong/memberships/${{ github.event.pull_request.user.login }}

- name: Add Label if Author is not a member
if: steps.check_membership.outputs.data.state != 'active'
run: |
echo "Author is not a member. Adding label..."
TOKEN=${{ secrets.GITHUB_TOKEN }
PR_NUMBER=${{ github.event.pull_request.number }}
LABEL="author/community"
API_URL="https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/labels"

curl -X POST -H "Authorization: token $TOKEN" -d '["'"$LABEL"'"]' $API_URL