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

Exlcuding draft PRs doesn't work #19

Open
GrahamBorland opened this issue Apr 15, 2020 · 5 comments
Open

Exlcuding draft PRs doesn't work #19

GrahamBorland opened this issue Apr 15, 2020 · 5 comments

Comments

@GrahamBorland
Copy link

GrahamBorland commented Apr 15, 2020

Using v1.0.0 of this action, the action runs on PRs which are created as Draft, and which have never been moved to the Open/ready-for-review state.

I have set include-draft: false in the config:

name: "Assign Reviewers"
on:  
  pull_request:
    types: [opened, ready_for_review]

jobs:
  assign-reviewers:
    runs-on: ubuntu-latest
    steps:
    - name: "Request review from Android team"
      uses: rowi1de/[email protected]
      with:
        repo-token: ${{ secrets.YBOT_ACCESS_TOKEN }}
        teams: "android"                # only works for GitHub Organisation/Teams
        persons: ""                     # add individual persons here 
        include-draft: false            # Draft PRs will be skipped (default: false)

Is there something else I need to do to exclude Draft PRs?

@rowi1de
Copy link
Owner

rowi1de commented Jul 21, 2020

Hey @GrahamBorland,

do you have an exmaple PR?
Or can you share the logs?

@GrahamBorland
Copy link
Author

@rowi1de I don't have any recent logs or public PRs, I'm afraid. I ended up working around it by changing the config so that the action only runs when PRs are explicitly moved to the ready_for_review state. This solved the problem for us where the action would run on newly created draft PRs.

types: [ready_for_review]

@rowi1de
Copy link
Owner

rowi1de commented Jul 21, 2020

Ok I wasn't able to replicate the issue.

@rowi1de rowi1de closed this as completed Jul 21, 2020
@stkent
Copy link

stkent commented Aug 31, 2020

@rowi1de I have a public repo that demonstrates this issue with the latest (v.1.0.1) version of the action.

I expected there to be no reviewer assigned as this PR is a draft.

But the workflow ran with the following output: https://github.com/stkent/GitHubActionsTesting/pull/11/checks?check_run_id=1052303655

Run rowi1de/[email protected]
  with:
    repo-token: ***
    persons: pr-bot
    include-draft: false
Adding persons: pr-bot
Request Status:201, Persons: pr-bot
Adding teams: 
Request Status:201, Teams:

and did indeed assign pr-bot to the PR.

I confirmed by fetching the PR details from the GitHub API manually that "draft": true is set for this PR.

Please reopen the issue and investigate! Let me know if you need any more information from me :) Thanks!

@adipatel
Copy link

adipatel commented Jan 22, 2021

Please reopen this issue !

I'm also having similar problems

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