Skip to content

Commit 8f23e81

Browse files
committed
Fix to set head commit hash
Signed-off-by: Yoshiki Fujikane <[email protected]>
1 parent acf9ba5 commit 8f23e81

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/app/pipedv1/livestatereporter/livestatereporter.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,13 @@ func (r *reporter) flush(ctx context.Context, app *model.Application, repo git.R
193193
return err
194194
}
195195

196-
dsp := deploysource.NewProvider(dir, deploysource.NewLocalSourceCloner(repo, "target", "HEAD"), app.GitPath, r.secretDecrypter)
196+
headCommit, err := repo.GetLatestCommit(ctx)
197+
if err != nil {
198+
r.logger.Error("failed to get latest commit", zap.Error(err))
199+
return err
200+
}
201+
202+
dsp := deploysource.NewProvider(dir, deploysource.NewLocalSourceCloner(repo, "target", headCommit.Hash), app.GitPath, r.secretDecrypter)
197203
ds, err := dsp.Get(ctx, io.Discard)
198204
if err != nil {
199205
r.logger.Error("failed to get deploy source", zap.String("application-id", app.Id), zap.Error(err))

0 commit comments

Comments
 (0)