diff --git a/src/main.ts b/src/main.ts index 51e38949d..2af069ee5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -10,7 +10,9 @@ async function run(): Promise { const expectedContent: string = core.getInput('expectedContent'); console.log(`Polling url ${url} for ${attempts} attempts with a delay of ${interval}`); - console.log(`Awaiting specified content: ${expectedContent}`); + if (expectedContent) { + console.log(`Awaiting specified content: ${expectedContent}`); + } let currentAttempt = 1; @@ -25,9 +27,16 @@ async function run(): Promise { continue; // skip rest of current iteration } - if (String(response?.data) === expectedContent) { - console.log('expected content found... proceeding'); - process.exit(0); + if (expectedContent) { + if (String(response?.data) === expectedContent) { + console.log('expected content found... proceeding'); + process.exit(0); + } + } else { + if (response?.status === 200) { + console.log('expected status code found... proceeding'); + process.exit(0); + } } console.log(