Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions api/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,15 @@ func RestartBuild(c *gin.Context) {
b.SetRuntime("")
b.SetDistribution("")

// update the PR event action if action was never set
// for backwards compatibility with pre-0.14 releases.
if b.GetEvent() == constants.EventPull && b.GetEventAction() == "" {
// technically, the action could have been opened or synchronize.
// will not affect behavior of the pipeline since we did not
// support actions for builds where this would be the case.
b.SetEventAction(constants.ActionOpened)
}

// set the parent equal to the restarted build number
b.SetParent(b.GetNumber())
// update the build numbers based off repo counter
Expand Down