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

Allow to control fetching tags via CIRRUS_CLONE_TAGS #354

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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