@@ -950,8 +950,11 @@ class GitHubHelper {
950
950
repo: repo
951
951
};
952
952
}
953
- createOrUpdate(inputs, baseRepository, headBranch ) {
953
+ createOrUpdate(inputs, baseRepository, headRepository ) {
954
954
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}`;
955
958
// Try to create the pull request
956
959
try {
957
960
core.info(`Attempting creation of pull request`);
@@ -974,7 +977,7 @@ class GitHubHelper {
974
977
}
975
978
// Update the pull request that exists for this branch and base
976
979
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 }));
978
981
core.info(`Attempting update of pull request`);
979
982
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 }));
980
983
core.info(`Updated pull request #${pull.number} (${headBranch} => ${inputs.base})`);
@@ -996,10 +999,8 @@ class GitHubHelper {
996
999
}
997
1000
createOrUpdatePullRequest(inputs, baseRepository, headRepository) {
998
1001
return __awaiter(this, void 0, void 0, function* () {
999
- const [headOwner] = headRepository.split('/');
1000
- const headBranch = `${headOwner}:${inputs.branch}`;
1001
1002
// Create or update the pull request
1002
- const pull = yield this.createOrUpdate(inputs, baseRepository, headBranch );
1003
+ const pull = yield this.createOrUpdate(inputs, baseRepository, headRepository );
1003
1004
// Apply milestone
1004
1005
if (inputs.milestone) {
1005
1006
core.info(`Applying milestone '${inputs.milestone}'`);
0 commit comments