Skip to content

Commit a4f52f8

Browse files
authored
fix: list pulls using the correct head format (#2792)
1 parent 853c071 commit a4f52f8

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

dist/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,6 @@ class GitHubHelper {
11091109
return __awaiter(this, void 0, void 0, function* () {
11101110
const [headOwner] = headRepository.split('/');
11111111
const headBranch = `${headOwner}:${inputs.branch}`;
1112-
const headBranchFull = `${headRepository}:${inputs.branch}`;
11131112
// Try to create the pull request
11141113
try {
11151114
core.info(`Attempting creation of pull request`);
@@ -1131,7 +1130,7 @@ class GitHubHelper {
11311130
}
11321131
// Update the pull request that exists for this branch and base
11331132
core.info(`Fetching existing pull request`);
1134-
const { data: pulls } = yield this.octokit.rest.pulls.list(Object.assign(Object.assign({}, this.parseRepository(baseRepository)), { state: 'open', head: headBranchFull, base: inputs.base }));
1133+
const { data: pulls } = yield this.octokit.rest.pulls.list(Object.assign(Object.assign({}, this.parseRepository(baseRepository)), { state: 'open', head: headBranch, base: inputs.base }));
11351134
core.info(`Attempting update of pull request`);
11361135
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 }));
11371136
core.info(`Updated pull request #${pull.number} (${headBranch} => ${inputs.base})`);

src/github-helper.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export class GitHubHelper {
4848
): Promise<Pull> {
4949
const [headOwner] = headRepository.split('/')
5050
const headBranch = `${headOwner}:${inputs.branch}`
51-
const headBranchFull = `${headRepository}:${inputs.branch}`
5251

5352
// Try to create the pull request
5453
try {
@@ -85,7 +84,7 @@ export class GitHubHelper {
8584
const {data: pulls} = await this.octokit.rest.pulls.list({
8685
...this.parseRepository(baseRepository),
8786
state: 'open',
88-
head: headBranchFull,
87+
head: headBranch,
8988
base: inputs.base
9089
})
9190
core.info(`Attempting update of pull request`)

0 commit comments

Comments
 (0)