Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use protocol v2 for checking out repo #78

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
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
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`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?


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
Loading