Skip to content

Commit

Permalink
fix(ci): add draft check in the workflow yaml (#8396)
Browse files Browse the repository at this point in the history
## Problem
Currently the tests runs on draft PR as well which is waste of
resources.

## Solution
Add a `if: ! github.event.pull_request.draft` check to prevent GH runs
on draft PRs. Reference:
https://stackoverflow.com/questions/68349031/only-run-actions-on-non-draft-pull-request
  • Loading branch information
all-seeing-code authored Oct 28, 2022
1 parent c6ca6bd commit f2f040f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci-aqua-security-trivy-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@ on:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- main
schedule:
- cron: "0 * * * *"
jobs:
build:
name: trivy-tests
if: github.event.pull_request.draft == false
runs-on: ubuntu-20.04
steps:
- name: Checkout code
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci-dgraph-load-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ on:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- main
schedule:
- cron: "0 * * * *"
jobs:
dgraph-load-tests:
if: github.event.pull_request.draft == false
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci-dgraph-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ on:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- main
schedule:
- cron: "0 * * * *"
jobs:
dgraph-tests:
if: github.event.pull_request.draft == false
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci-golang-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ on:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- main
schedule:
- cron: "0 * * * *"
jobs:
golang-lint:
if: github.event.pull_request.draft == false
name: lint
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit f2f040f

Please sign in to comment.