Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions actions/run-jenkins-job/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,14 @@ axios.post(jobBuildUrl, qs.stringify(queryParamJson), { auth: basicAuth })
core.info("Job successfully started")
core.info(`Build URL is ${response.data.executable.url}`)
if (waitForCompletion == "true") {
const buildUrl = `${response.data.executable.url}api/json?tree=result`
let buildUrl = `${response.data.executable.url}api/json?tree=result`
const internalJenkinsDomain = 'https://jenkins.mgmt.totango.com';
// for GitHub Actions we need to use external Jenkins Domain,
// but the job has inside only internal domain
if (buildUrl.startsWith(internalJenkinsDomain)) {
buildUrl = buildUrl.replace(internalJenkinsDomain, 'https://jenkins.totango.com');
}

core.info(`Waiting for job completion, polling via ${buildUrl}`)
pollForBuildCompletion(buildUrl)
.then((response) => {
Expand All @@ -105,4 +112,4 @@ axios.post(jobBuildUrl, qs.stringify(queryParamJson), { auth: basicAuth })
})
.catch((error) => {
core.setFailed(error.message)
})
})