diff --git a/dist/index.js b/dist/index.js index 9a3629d5..47fdbf6e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -567,8 +567,17 @@ async function main() { ); if (remoteBranchExists) { - core.info(`Existing pull request for "${inputs.branch}" updated`); - return; + const q = `head:${inputs.branch} type:pr is:open repo:${process.env.GITHUB_REPOSITORY}`; + const { data } = await request("GET /search/issues", { + q + }); + + if (data.total_count > 0) { + core.info( + `Existing pull request for branch "${inputs.branch}" updated: ${data.items.html_url}` + ); + return; + } } core.debug(`Creating pull request`);