feat: resolve PR or branch name
Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
parent
f62ed2e4a3
commit
eda2f5153d
1 changed files with 5 additions and 2 deletions
|
@ -69,8 +69,11 @@ func GetPRIndex(client *gitea.Client, prIndex *int64) error {
|
||||||
core.ExitOnError("Couldn't list pull requests", err)
|
core.ExitOnError("Couldn't list pull requests", err)
|
||||||
|
|
||||||
for _, pr := range prs {
|
for _, pr := range prs {
|
||||||
if pr.Head.Name == branch {
|
if *prIndex != -1 && pr.ID == *prIndex {
|
||||||
*prID = pr.ID
|
*prIndex = pr.Index
|
||||||
|
return nil
|
||||||
|
} else if pr.Head.Name == branch {
|
||||||
|
*prIndex = pr.Index
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue