diff --git a/api/build.go b/api/build.go index c508d2bef..075a80c36 100644 --- a/api/build.go +++ b/api/build.go @@ -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