Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Allow to control fetching tags via CIRRUS_CLONE_TAGS (#354)
Browse files Browse the repository at this point in the history
Fixes #351
  • Loading branch information
fkorotkov committed Mar 28, 2024
1 parent df2d1da commit b2ea235
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/executor/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ func CloneRepository(
var repo *git.Repository
var err error

tagsOption := git.NoTags
if env.Get("CIRRUS_CLONE_TAGS") == "true" {
tagsOption = git.AllTags
}
if is_pr {
repo, err = git.PlainInit(working_dir, false)
if err != nil {
Expand Down Expand Up @@ -86,7 +90,7 @@ func CloneRepository(
fetchOptions := &git.FetchOptions{
RemoteName: remoteConfig.Name,
RefSpecs: []config.RefSpec{config.RefSpec(refSpec)},
Tags: git.NoTags,
Tags: tagsOption,
Progress: logUploader,
Depth: clone_depth,
}
Expand Down Expand Up @@ -135,7 +139,7 @@ func CloneRepository(
Depth: clone_depth,
}
if !is_tag {
cloneOptions.Tags = git.NoTags
cloneOptions.Tags = tagsOption
}

if is_tag {
Expand Down

0 comments on commit b2ea235

Please sign in to comment.