Skip to content

Commit 0776c3a

Browse files
fetch tags when fetch-depth > 0. fix actions#1781
1 parent cbb7224 commit 0776c3a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: src/git-command-manager.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,12 @@ class GitCommandManager {
261261
}
262262
): Promise<void> {
263263
const args = ['-c', 'protocol.version=2', 'fetch']
264-
if (!refSpec.some(x => x === refHelper.tagsRefSpec) && !options.fetchTags) {
265-
args.push('--no-tags')
264+
if (options.fetchTags) {
265+
args.push('--tags')
266+
} else {
267+
if (!refSpec.some(x => x === refHelper.tagsRefSpec)) {
268+
args.push('--no-tags')
269+
}
266270
}
267271

268272
args.push('--prune', '--no-recurse-submodules')

0 commit comments

Comments
 (0)