@@ -32345,8 +32345,6 @@ const fs = __nccwpck_require__(7147);
3234532345
3234632346async function run() {
3234732347 try {
32348- const baseBranch = core.getInput("base");
32349- const headBranch = core.getInput("head");
3235032348 const freshSnapshot = core.getInput("fresh-shapshots")==='true';
3235132349 const includeFuzzTests = core.getInput('include-fuzz-tests')==='true';
3235232350 const includeNewContracts = core.getInput('include-new-contracts')==='true';
@@ -32358,13 +32356,19 @@ async function run() {
3235832356 const genCommit = context.payload.pull_request.head.sha;
3235932357 const comCommit = context.payload.pull_request.base.sha;
3236032358
32359+ const headRepoFullName = context.payload.pull_request.head.repo.full_name;
32360+ const headBranch = context.payload.pull_request.head.ref;
32361+
32362+ const baseRepoFullName = context.payload.pull_request.base.repo.full_name;
32363+ const baseBranch = context.payload.pull_request.base.ref;
32364+
3236132365 if (freshSnapshot) {
3236232366 core.startGroup(`Generating the .gas-snapshot file from "${headBranch}"`);
32363- await generateGasSnapshot(headBranch, ".gas-snapshot.pr");
32367+ await generateGasSnapshot(headRepoFullName, headBranch, ".gas-snapshot.pr");
3236432368 core.endGroup()
3236532369
3236632370 core.startGroup(`Generating the .gas-snapshot file from "${baseBranch}"`);
32367- await generateGasSnapshot(baseBranch, ".gas-snapshot.base");
32371+ await generateGasSnapshot(baseRepoFullName, baseBranch, ".gas-snapshot.base");
3236832372 core.endGroup()
3236932373
3237032374 } else {
@@ -32420,8 +32424,10 @@ async function getGitFileContent(octokit, owner, repo, ref, filePath) {
3242032424 }
3242132425}
3242232426
32423- async function generateGasSnapshot(refBranch, fileName) {
32424- await exec.exec('git', ['checkout', refBranch])
32427+ async function generateGasSnapshot(repoFullName, branchName, fileName) {
32428+ await exec.exec('git', ['fetch', `https://github.com/${repoFullName}`, `${branchName}`]);
32429+ await exec.exec('git', ['checkout', '-b', branchName, `FETCH_HEAD`]);
32430+
3242532431 const options = {
3242632432 ignoreReturnCode: true,
3242732433 silent: true
0 commit comments