[PATCH] D123657: [workflow] Don't fail workflow if we already have a PR for an issue
Tobias Hieta via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 14 00:21:11 PDT 2022
thieta added inline comments.
================
Comment at: llvm/utils/git/github-automation.py:15
+import github.Repository
+import github.PullRequest
import os
----------------
tstellar wrote:
> Do we need these if we already have import github ?
I think vscode was adding this because I used them in the type-hinting below. I removed the lines again.
================
Comment at: llvm/utils/git/github-automation.py:197
+ def check_if_pull_request_exists(self, repo:github.Repository.Repository, title:str) -> Optional[github.PullRequest.PullRequest]:
+ for pr in repo.get_pulls():
+ if pr.title == title:
----------------
tstellar wrote:
> I think you can access the pull request directly based on the head branch: repo.get_pull(head='owner:branch')
Yeah I changed it to that now - but this can in theory return multiple PR's. I wonder if we need to handle this better if we get multiple matches. But I struggled to see how that would matter.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123657/new/
https://reviews.llvm.org/D123657
More information about the llvm-commits
mailing list