Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Close PRs adding a blank file #5

Open
j-f1 opened this issue Feb 24, 2018 · 1 comment
Open

Close PRs adding a blank file #5

j-f1 opened this issue Feb 24, 2018 · 1 comment

Comments

@j-f1
Copy link

j-f1 commented Feb 24, 2018

I’ve seen some PRs opened on desktop/Desktop that just add a blank file. Would it be possible to close these if they’re not opened by collaborators?

Examples: desktop/desktop#4144, desktop/desktop#4097, desktop/desktop#4087, desktop/desktop#3944

@j-f1
Copy link
Author

j-f1 commented Mar 1, 2018

Idea about how to implement it:

  1. GET /repos/:slug/pulls/:id/commits, check if length 1.
  2. GET the value of 0.commit.url
  3. check if files.length is 1 and files[0].patch === "@@ -0,0 +1 @@\n+"
  4. Close the PR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant