ci: Skip some actions if the PR is a draft (#191)

- Don't run github actions on draft pull requests
- Now the title checker won't be affected, seems due to it was triggered by pull_request_target, not pull_request event
This commit is contained in:
evenyag
2022-08-19 17:54:30 +08:00
committed by GitHub
parent cab20cfd3e
commit 144ea348c7
2 changed files with 9 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
push:
branches:
- "main"
@@ -12,6 +13,7 @@ env:
jobs:
grcov:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

View File

@@ -1,4 +1,6 @@
on: [pull_request]
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
name: Continuous integration for developing
@@ -8,6 +10,7 @@ env:
jobs:
check:
name: Check
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@@ -24,6 +27,7 @@ jobs:
test:
name: Test Suite
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@@ -45,6 +49,7 @@ jobs:
fmt:
name: Rustfmt
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@@ -62,6 +67,7 @@ jobs:
clippy:
name: Clippy
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2