-
Notifications
You must be signed in to change notification settings - Fork 9
Enable closing pr during resetting and re-downloading #75
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
Changes from all commits
5103925
9e2d52d
028de91
705a85e
f4cd319
3d68759
dc6b6ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -198,3 +198,42 @@ def get_user_prs(repo: str, owner: str) -> List[str]: | |
| prs = result.stdout.splitlines() | ||
| return prs | ||
| return [] | ||
|
|
||
|
|
||
| def close_prs(repo: str) -> None: | ||
| """Close all open pull requests authored by the current user in `repo`.""" | ||
|
|
||
| result = run( | ||
| [ | ||
| "gh", | ||
| "pr", | ||
| "list", | ||
| "--repo", | ||
| repo, | ||
| "--author", | ||
| "@me", | ||
| "--state", | ||
| "open", | ||
|
desmondwong1215 marked this conversation as resolved.
|
||
| "--json", | ||
| "number", | ||
| "--jq", | ||
| ".[].number", | ||
| ], | ||
|
Comment on lines
+207
to
+221
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This only fetches the first 30 PRs, and while technically the better option would be to add a flag of the form |
||
| env={"GH_PAGER": "cat"}, | ||
| ) | ||
|
|
||
| if not result.is_success(): | ||
| return | ||
|
|
||
| for pr_number in result.stdout.splitlines(): | ||
| run( | ||
| [ | ||
| "gh", | ||
| "pr", | ||
| "close", | ||
|
desmondwong1215 marked this conversation as resolved.
|
||
| pr_number, | ||
| "--repo", | ||
| repo, | ||
| ], | ||
| env={"GH_PAGER": "cat"}, | ||
| ) | ||
Uh oh!
There was an error while loading. Please reload this page.