Skip to content

Commit

Permalink
fix: change the git clone url
Browse files Browse the repository at this point in the history
`.git_url` seems to be of the form `git://` that doesn't seem to be valid
anymore for github. This commit replaces it and uses `.clone_url` instead to clone
the repo
  • Loading branch information
yabirgb authored and kelsos committed Dec 16, 2024
1 parent 71c4f76 commit d18f79d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 3 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions src/changes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@ import type { ComparedDatabases, FileVersions } from './types';
import type { PullRequest } from '@octokit/webhooks-types/schema';

function cloneRepo(target: 'head' | 'base', url: string, ref: string, sha: string): string {
let cloneUrl = url;
const cloneUrl = url;

validateGitUrl(cloneUrl);

if (cloneUrl.startsWith('git'))
cloneUrl = cloneUrl.replace('git', 'https');

const repo = createDBDir(target, 'repo');
core.info(`cloning ${cloneUrl} @ ${ref} as ${target} to ${repo}`);
const args = ['clone', cloneUrl, '--branch', ref, '--depth', '1', repo];
Expand Down Expand Up @@ -82,8 +79,8 @@ export async function prepareForDiff(): Promise<FileVersions[]> {
if (files.length === 0)
return [];

const baseRepoUrl = base.repo.git_url;
const headRepoUrl = head.repo?.git_url;
const baseRepoUrl = base.repo.clone_url;
const headRepoUrl = head.repo?.clone_url;

if (!headRepoUrl)
throw new Error(`head repo url is missing ${headRepoUrl}`);
Expand Down

0 comments on commit d18f79d

Please sign in to comment.