diff --git a/dist/index.js b/dist/index.js index 355c1499..48820f07 100644 --- a/dist/index.js +++ b/dist/index.js @@ -11546,10 +11546,13 @@ done`; // being built. let repoFullName = process.env.GITHUB_REPOSITORY; if (github.context.payload.pull_request) { - repoFullName = github.context.payload.pull_request.head.repo.full_name; + repoFullName = github.context.payload.pull_request.base.repo.full_name; } const headRef = process.env.GITHUB_HEAD_REF; - const commitRef = headRef || github.context.sha; + let commitRef = headRef || github.context.sha; + if (github.context.payload.pull_request) { + commitRef = github.context.sha; + } const repoFilePath = path.join(rosWorkspaceDir, "package.repo"); // Add a random string prefix to avoid naming collisions when checking out the test repository const randomStringPrefix = Math.random().toString(36).substring(2, 15); diff --git a/src/action-ros-ci.ts b/src/action-ros-ci.ts index f432e59d..28b99adc 100644 --- a/src/action-ros-ci.ts +++ b/src/action-ros-ci.ts @@ -555,10 +555,13 @@ done`; // being built. let repoFullName = process.env.GITHUB_REPOSITORY as string; if (github.context.payload.pull_request) { - repoFullName = github.context.payload.pull_request.head.repo.full_name; + repoFullName = github.context.payload.pull_request.base.repo.full_name; } const headRef = process.env.GITHUB_HEAD_REF as string; - const commitRef = headRef || github.context.sha; + let commitRef = headRef || github.context.sha; + if (github.context.payload.pull_request) { + commitRef = github.context.sha; + } const repoFilePath = path.join(rosWorkspaceDir, "package.repo"); // Add a random string prefix to avoid naming collisions when checking out the test repository const randomStringPrefix = Math.random().toString(36).substring(2, 15);