Add label workflow for community issues and pulls (#1406)
* Add label workflow for community issues and pulls
* run on label changes
(cherry picked from commit 006cb0e702)
This commit is contained in:
committed by
github-actions[bot]
parent
4bd62ef5c9
commit
986a515a62
@@ -0,0 +1,38 @@
|
||||
name: Community
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
issues:
|
||||
types:
|
||||
- opened
|
||||
label:
|
||||
types: ["*"]
|
||||
|
||||
jobs:
|
||||
community-label:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Determine membership
|
||||
uses: actions/github-script@v4
|
||||
id: membership
|
||||
with:
|
||||
github-token: ${{ secrets.READ_ORG_TOKEN }}
|
||||
script: |
|
||||
return github.orgs.getMembershipForAuthenticatedUser({
|
||||
org: "elastic",
|
||||
username: context.payload.sender.login
|
||||
})
|
||||
- name: Add community label for users not in Elastic org
|
||||
uses: actions/github-script@v4
|
||||
if: |
|
||||
"${{ steps.membership.outputs.result.state }}" != "active"
|
||||
with:
|
||||
script: |
|
||||
github.issues.addLabels({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
labels: ['community']
|
||||
})
|
||||
Reference in New Issue
Block a user