diff --git a/pkg/app/piped/planpreview/builder.go b/pkg/app/piped/planpreview/builder.go index 1a307ea259..fe827e9161 100644 --- a/pkg/app/piped/planpreview/builder.go +++ b/pkg/app/piped/planpreview/builder.go @@ -377,12 +377,6 @@ func (b *builder) listApplications(repo config.PipedRepository) []*model.Applica if app.GitPath.Repo.Id != repo.RepoID { continue } - if app.GitPath.Repo.Remote != repo.Remote { - continue - } - if app.GitPath.Repo.Branch != repo.Branch { - continue - } out = append(out, app) } diff --git a/pkg/app/piped/trigger/deployment.go b/pkg/app/piped/trigger/deployment.go index c3576b92aa..93ff8d3dd0 100644 --- a/pkg/app/piped/trigger/deployment.go +++ b/pkg/app/piped/trigger/deployment.go @@ -40,7 +40,7 @@ func (t *Trigger) triggerDeployment( return nil } -func buildDeployment( +func (t *Trigger) buildDeployment( app *model.Application, branch string, commit git.Commit, @@ -55,6 +55,10 @@ func buildDeployment( var commitURL string if r := app.GitPath.Repo; r != nil { + if repo, ok := t.config.GetRepository(r.Id); ok { + r.Branch = repo.Branch + r.Remote = repo.Remote + } url, err := git.MakeCommitURL(r.Remote, commit.Hash) if err != nil { return nil, err diff --git a/pkg/app/piped/trigger/trigger.go b/pkg/app/piped/trigger/trigger.go index e73b1f15bb..4d20ea2751 100644 --- a/pkg/app/piped/trigger/trigger.go +++ b/pkg/app/piped/trigger/trigger.go @@ -296,7 +296,7 @@ func (t *Trigger) checkRepoCandidates(ctx context.Context, repoID string, cs []c } // Build the deployment to trigger. - deployment, err := buildDeployment( + deployment, err := t.buildDeployment( app, branch, headCommit,