-
Notifications
You must be signed in to change notification settings - Fork 839
30 lines (28 loc) · 1.33 KB
/
community_contribution.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: "Community contribution"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] # Remove all except opened before merging
jobs:
# Add a comment to manually start Buildkite for community contributions
community-pr-message:
env:
EUI_REPO: ${{ github.event.pull_request.base.repo.url }}
HEAD_REPO: ${{ github.event.pull_request.head.repo.url }}
SUBMITTER_ASSOCIATION: ${{ github.event.pull_request.author_association }}
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
name: "Check community access and comment"
if: |
${{ env.EUI_REPO != env.HEAD_REPO }} &&
${{ env.SUBMITTER_ASSOCIATION != 'MEMBER' && env.SUBMITTER_ASSOCIATION != 'CONTRIBUTOR' }}
with:
script: |
const pr = context.payload.pull_request
const comment = "Since this is a community submitted pull request, a Buildkite build has not been kicked off automatically. Would an Elastic organization member please verify the contents of this patch and then kick off a build manually?"
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment,
});