Skip to content

[INFRA] Building GitHub Action to comment on community PRs #5

[INFRA] Building GitHub Action to comment on community PRs

[INFRA] Building GitHub Action to comment on community PRs #5

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 }}
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
SUBMITTER_ASSOCIATION: ${{ github.event.pull_request.author_association }}
runs-on: ubuntu-latest
steps:
- name: "Check contributor access"
if: |
${{ env.EUI_REPO != env.HEAD_REPO }} &&
${{ env.SUBMITTER_ASSOCIATION == 'MEMBER' || env.SUBMITTER_ASSOCIATION == 'CONTRIBUTOR' }}
run: |
echo "This was a contributor submission."
exit 1
- name: "Check community access"
if: |
${{ env.EUI_REPO != env.HEAD_REPO }} &&
${{ env.SUBMITTER_ASSOCIATION != 'MEMBER' && env.SUBMITTER_ASSOCIATION != 'CONTRIBUTOR' }}
run: |
echo "This was a community submission."
exit 1