[INFRA] Building GitHub Action to comment on community PRs #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "Test for community contribution" | |
if: | | |
${{ env.EUI_REPO != env.HEAD_REPO }} && | |
${{ env.SUBMITTER_ASSOCIATION != 'MEMBER' && env.SUBMITTER_ASSOCIATION != 'CONTRIBUTOR' }} | |
run: | | |
echo "This is a community submission." | |
exit 0 | |
- name: "Test for forked member contribution" | |
if: | | |
${{ env.EUI_REPO != env.HEAD_REPO }} && | |
${{ env.SUBMITTER_ASSOCIATION == 'MEMBER' || env.SUBMITTER_ASSOCIATION == 'CONTRIBUTOR' }} | |
run: | | |
echo "This is a forked member submission." | |
exit 0 |