Skip to content

Commit

Permalink
Fix pull request job to only run when necessary (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasBuelens authored Sep 25, 2019
1 parent 2376a66 commit 5fd3834
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@ jobs:
strategy:
matrix:
node-version: [8.x, 10.x, 12.x]
# Run only on non-merged non-draft mergeable pull requests
if: |
!(
(github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'synchronize')
&& !github.event.pull_request.draft
&& !github.event.pull_request.merged
&& github.event.pull_request.merge_commit_sha != null
)
steps:
- name: Check event
# Run only on non-merged non-draft mergeable pull requests
if: |
!(
(github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'synchronize')
&& !github.event.pull_request.draft
&& !github.event.pull_request.merged
&& github.event.pull_request.merge_commit_sha != null
)
# Exit code stops the workflow with a neutral status
# https://developer.github.com/actions/creating-github-actions/accessing-the-runtime-environment/#exit-codes-and-statuses
run: exit 78
- name: Check out merge commit of pull request
uses: actions/checkout@v1
with:
Expand Down

0 comments on commit 5fd3834

Please sign in to comment.