Skip to content

Commit

Permalink
use protocol v2 for checking out repo (#78)
Browse files Browse the repository at this point in the history
Co-authored-by: Miroslav Jonaš <[email protected]>
  • Loading branch information
2 people authored and github-actions[bot] committed Dec 17, 2024
1 parent d1f3eb9 commit 6ce9e74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion workflow-steps/checkout/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ if (process.platform != 'win32') {
}
execSync('git init .');
execSync(`git remote add origin ${repoUrl}`);
execSync(`echo "GIT_REPOSITORY_URL=''" >> $NX_CLOUD_ENV`);

if (depth === '0') {
// Fetch all branches and tags if depth is 0
execSync(
'git fetch --prune --progress --no-recurse-submodules --tags origin "+refs/heads/*:refs/remotes/origin/*"',
'git fetch -c protocol.version=2 --prune --progress --no-recurse-submodules --tags origin "+refs/heads/*:refs/remotes/origin/*"',
);
} else {
// Fetch with specified depth
Expand Down
3 changes: 2 additions & 1 deletion workflow-steps/checkout/output/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ if (process.platform != "win32") {
}
(0, import_child_process.execSync)("git init .");
(0, import_child_process.execSync)(`git remote add origin ${repoUrl}`);
(0, import_child_process.execSync)(`echo "GIT_REPOSITORY_URL=''" >> $NX_CLOUD_ENV`);
if (depth === "0") {
(0, import_child_process.execSync)(
'git fetch --prune --progress --no-recurse-submodules --tags origin "+refs/heads/*:refs/remotes/origin/*"'
'git fetch -c protocol.version=2 --prune --progress --no-recurse-submodules --tags origin "+refs/heads/*:refs/remotes/origin/*"'
);
} else {
const tagsArg = fetchTags ? " --tags" : "--no-tags";
Expand Down

0 comments on commit 6ce9e74

Please sign in to comment.