Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions .github/workflows/skip_draft_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: skip draft pr
on: pull_request

jobs:
build:
if: "!(github.event.pull_request.draft)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ GitHub Actions laboratory.
- [Issue and Pull Request handling](#issue-and-pull-request-handling)
- [skip ci on pull request title](#skip-ci-on-pull-request-title)
- [skip pr from fork repo](#skip-pr-from-fork-repo)
- [detect tag on pull request](#detect-tag-on-pull-request)

</details>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -870,3 +869,20 @@ jobs:
- run: echo "run!"
if: env.IS_HOGE == 'true'
```

### skip job when Draft PR

You can skip job and steps if Pull Request is Draft.
Unfortunately GitHub Webhook v3 event not provide draft pr type, but `event.pull_request.draft` shows `true` when PR is draft.

```yaml
name: skip draft pr
on: pull_request

jobs:
build:
if: "!(github.event.pull_request.draft)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
```