Skip to content

Commit

Permalink
Figure out why GITHUB_SHA is true
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsnell committed Oct 27, 2022
1 parent 0d71db8 commit 5596c71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bin/plugin/commands/performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ async function runPerformanceTests( branches, options ) {
const baseDirectory = await git.cloneAt(
config.gitRepositoryURL,
options.mergeRef,
options.ci
options.testsBranch
);
const rootDirectory = getRandomTemporaryPath();
const performanceTestDirectory = rootDirectory + '/tests';
Expand Down
12 changes: 6 additions & 6 deletions bin/plugin/lib/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ async function clone( repositoryUrl ) {
async function cloneAt( repositoryUrl, ref, sha ) {
const gitWorkingDirectoryPath = getRandomTemporaryPath();
fs.mkdirSync( gitWorkingDirectoryPath, { recursive: true } );
const simpleGit = SimpleGit( gitWorkingDirectoryPath );
await simpleGit.init();
await simpleGit.addRemote( 'origin', repositoryUrl );
console.log( `>>> Fetching ${ ref } (${ sha })` );
await simpleGit.raw( 'fetch', '--depth=1', 'origin', ref );
await simpleGit.raw( 'checkout', sha );
console.log( `>>> Fetching ${ ref } (${ sha }) at ${ repositoryUrl }` );
await SimpleGit( gitWorkingDirectoryPath )
.raw( 'init' )
.raw( 'remote', 'add', 'origin', repositoryUrl )
.raw( 'fetch', '--depth=1', 'origin', ref )
.raw( 'checkout', sha );
return gitWorkingDirectoryPath;
}

Expand Down

0 comments on commit 5596c71

Please sign in to comment.