@@ -950,8 +950,11 @@ class GitHubHelper {
950950 repo: repo
951951 };
952952 }
953- createOrUpdate(inputs, baseRepository, headBranch ) {
953+ createOrUpdate(inputs, baseRepository, headRepository ) {
954954 return __awaiter(this, void 0, void 0, function* () {
955+ const [headOwner] = headRepository.split('/');
956+ const headBranch = `${headOwner}:${inputs.branch}`;
957+ const headBranchFull = `${headRepository}:${inputs.branch}`;
955958 // Try to create the pull request
956959 try {
957960 core.info(`Attempting creation of pull request`);
@@ -974,7 +977,7 @@ class GitHubHelper {
974977 }
975978 // Update the pull request that exists for this branch and base
976979 core.info(`Fetching existing pull request`);
977- const { data: pulls } = yield this.octokit.rest.pulls.list(Object.assign(Object.assign({}, this.parseRepository(baseRepository)), { state: 'open', head: headBranch , base: inputs.base }));
980+ const { data: pulls } = yield this.octokit.rest.pulls.list(Object.assign(Object.assign({}, this.parseRepository(baseRepository)), { state: 'open', head: headBranchFull , base: inputs.base }));
978981 core.info(`Attempting update of pull request`);
979982 const { data: pull } = yield this.octokit.rest.pulls.update(Object.assign(Object.assign({}, this.parseRepository(baseRepository)), { pull_number: pulls[0].number, title: inputs.title, body: inputs.body }));
980983 core.info(`Updated pull request #${pull.number} (${headBranch} => ${inputs.base})`);
@@ -996,10 +999,8 @@ class GitHubHelper {
996999 }
9971000 createOrUpdatePullRequest(inputs, baseRepository, headRepository) {
9981001 return __awaiter(this, void 0, void 0, function* () {
999- const [headOwner] = headRepository.split('/');
1000- const headBranch = `${headOwner}:${inputs.branch}`;
10011002 // Create or update the pull request
1002- const pull = yield this.createOrUpdate(inputs, baseRepository, headBranch );
1003+ const pull = yield this.createOrUpdate(inputs, baseRepository, headRepository );
10031004 // Apply milestone
10041005 if (inputs.milestone) {
10051006 core.info(`Applying milestone '${inputs.milestone}'`);
0 commit comments