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

[GitHub CI] Add step to block PRs from forked repositories unless they have the right label #1627

Merged
merged 5 commits into from
Aug 20, 2019
Merged
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
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
name: CI

on: push
on: [push, pull_request]

jobs:
build-approval:
name: Build approval
runs-on: macOS-10.14
steps:
- name: Block if a pull request from a forked repository isn't from, and isn't labeled by, a maintainer
if: github.event_name == 'pull_request' && !contains('OWNER, MEMBER, COLLABORATOR', github.event.pull_request.author_association) && !contains(github.event.pull_request.labels.*.name, 'CI approved')
run: exit 255
- name: Approved!
if: failure() == false
run: exit 0
buildsh:
strategy:
matrix:
Expand All @@ -26,6 +36,7 @@ jobs:
name: Build examples (examples-pt4)
name: ${{ matrix.name }}
runs-on: macOS-10.14
needs: build-approval
steps:
- name: Checkout the Git repository
uses: actions/checkout@v1
Expand Down