Added an warning on status code 409

This commit is contained in:
Philipp Horstenkamp 2023-11-24 19:10:40 +01:00
parent 54c224ef33
commit 220e001fd3
Signed by: Philipp
GPG Key ID: DD53EAC36AFB61B4

View File

@ -51,7 +51,10 @@ async function getAndPostPullRequests() {
headers, headers,
body: JSON.stringify(postData), body: JSON.stringify(postData),
}); });
if (postResponse.status === 409) {
core.warning("PR between the branches already exists.");
return;
}
if (!postResponse.ok) { if (!postResponse.ok) {
throw new Error( throw new Error(
`HTTP error! status on creating a new PR: ${postResponse.status}`, `HTTP error! status on creating a new PR: ${postResponse.status}`,