aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/vcs/git.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/vcs/git.go')
-rw-r--r--pkg/vcs/git.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/vcs/git.go b/pkg/vcs/git.go
index d1a91404c..f8362dfb2 100644
--- a/pkg/vcs/git.go
+++ b/pkg/vcs/git.go
@@ -635,3 +635,12 @@ func (git *git) CommitExists(commit string) (bool, error) {
}
return true, nil
}
+
+func (git *git) PushCommit(repo, commit string) error {
+ tagName := "tag-" + commit // assign tag to guarantee remote persistence
+ git.git("tag", tagName) // ignore errors on re-tagging
+ if _, err := git.git("push", repo, "tag", tagName); err != nil {
+ return fmt.Errorf("git push %s tag %s: %w", repo, tagName, err)
+ }
+ return nil
+}