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

Only run on pull requests that are "ready for review" not "draft" pull request. #29

Closed
ChadTaljaardt opened this issue May 11, 2020 · 4 comments

Comments

@ChadTaljaardt
Copy link

Hello,

Is there a way to make this only run on pull requests which are ready for review instead of draft pull requests.

I tried adding the following type to "ready_for_review" which only gets run when marking the PR ready for review, but not on code changes then. So i added synchronize to make it work on code changes, but it runs on code changes even in draft pull requests.

I want it to only run on code changes on pull request which are ready for review.

@haya14busa
Copy link
Member

There is if expression in GitHub Actions, so you can implement filtering outside action-eslint.
https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idif

@ChadTaljaardt
Copy link
Author

Thanks for the pointer, ill look into it 👍

@odimko
Copy link

odimko commented Nov 19, 2021

but how would you check if a PR is ready for review @haya14busa ? that page just introduces if-statements, but not an actually expression to do so. any hints? :)

@timusus
Copy link

timusus commented Dec 4, 2021

@odimko

In your job, you can use the statement:

jobs:
  my_job:
    name: "Job Name"
    runs-on: ubuntu-latest
    if: ${{ !github.event.pull_request.draft }}

To ensure the job will not run against PR drafts.

But, you probably also want the job to run when the PR status changes from draft to 'ready for review'

As per the docs, the default 'types' of pull-request that trigger your CI are opened, reopened and synchronize. You need to specify ready_for_review. And, since you probably want the default as well, you will need to specify those explicitly:

name: Action Name

on:
  pull_request:
    branches: [my_branch]
    types:
      - opened
      - reopened
      - synchronize
      - ready_for_review

SimeonC added a commit to tablecheck/tablekit that referenced this issue Oct 5, 2022
To reduce the number of chromatic runs we are going to not run chromatic until the PR is marked as ready.
Reference reviewdog/action-eslint#29 (comment)
SimeonC added a commit to tablecheck/tablekit that referenced this issue Oct 5, 2022
To reduce the number of chromatic runs we are going to not run chromatic until the PR is marked as ready.
Reference reviewdog/action-eslint#29 (comment)
hello-binit added a commit to hello-robot/stretch_web_teleop that referenced this issue Oct 4, 2024
hello-vinitha added a commit to hello-robot/stretch_web_teleop that referenced this issue Oct 10, 2024
See reviewdog/action-eslint#29 (comment) for an explanation on how to filter out draft PRs.

Co-authored-by: hello-vinitha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants