Skip to content

Commit cffc319

Browse files
committed
change way to determine PRs for branch name
1 parent 2275007 commit cffc319

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/automated_ingestion/eessi_task.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -876,11 +876,11 @@ def _find_pr_for_branch(self, branch_name: str) -> Optional[PullRequest]:
876876
# head_ref = f"{self.git_repo.owner.login}:{branch_name}"
877877
# apparently, the head_ref does not contain the login
878878
filter_prs = [16, 17, 18, 19, 20, 21, 22] # TODO: remove this once the PR is merged
879-
prs = [pr for pr in list(self.git_repo.get_pulls(state='all', head=branch_name))
880-
if pr.number not in filter_prs]
879+
prs = [pr for pr in list(self.git_repo.get_pulls(state='all'))
880+
if pr.number not in filter_prs and pr.head.ref == branch_name]
881881
log_message(LoggingScope.TASK_OPS, 'INFO', "number of PRs found: %d", len(prs))
882882
if len(prs):
883-
log_message(LoggingScope.TASK_OPS, 'INFO', "1st PR found: %d", prs[0].number)
883+
log_message(LoggingScope.TASK_OPS, 'INFO', "1st PR found: %d, %s", prs[0].number, prs[0].head.ref)
884884
return prs[0] if prs else None
885885
except Exception as err:
886886
log_message(LoggingScope.TASK_OPS, 'ERROR', "Error finding PR for branch %s: %s", branch_name, err)

0 commit comments

Comments
 (0)