feat: resolve PR or branch name

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2023-03-28 22:12:05 +02:00
parent f62ed2e4a3
commit eda2f5153d
Signed by: mfocko
GPG key ID: 7C47D46246790496

View file

@ -69,8 +69,11 @@ func GetPRIndex(client *gitea.Client, prIndex *int64) error {
core.ExitOnError("Couldn't list pull requests", err)
for _, pr := range prs {
if pr.Head.Name == branch {
*prID = pr.ID
if *prIndex != -1 && pr.ID == *prIndex {
*prIndex = pr.Index
return nil
} else if pr.Head.Name == branch {
*prIndex = pr.Index
return nil
}
}