mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 07:19:20 +01:00
fix(be): use pointer for git branch
This commit is contained in:
parent
9c99e6bc9d
commit
c4d98b1136
@ -27,7 +27,7 @@ type Task struct {
|
||||
Limit string `db:"hosts_limit" json:"limit"`
|
||||
Secret string `db:"-" json:"secret"`
|
||||
Arguments *string `db:"arguments" json:"arguments"`
|
||||
GitBranch string `db:"git_branch" json:"git_branch"`
|
||||
GitBranch *string `db:"git_branch" json:"git_branch"`
|
||||
|
||||
UserID *int `db:"user_id" json:"user_id"`
|
||||
IntegrationID *int `db:"integration_id" json:"integration_id"`
|
||||
|
@ -471,8 +471,8 @@ func (t *LocalJob) prepareRun() error {
|
||||
}
|
||||
|
||||
// Override git branch from task if set
|
||||
if t.Task.GitBranch != "" {
|
||||
t.Repository.GitBranch = t.Task.GitBranch
|
||||
if t.Task.GitBranch != nil && *t.Task.GitBranch != "" {
|
||||
t.Repository.GitBranch = *t.Task.GitBranch
|
||||
}
|
||||
|
||||
if t.Repository.GetType() == db.RepositoryLocal {
|
||||
|
Loading…
Reference in New Issue
Block a user