Skip to content

Commit

Permalink
gh-actions/retest/: Get AZP working (#799)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Northey <ryan@synca.io>
  • Loading branch information
phlax authored Aug 20, 2023
1 parent b4802f0 commit 8da3476
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gh-actions/retest/dist/index.js

Large diffs are not rendered by default.

20 changes: 17 additions & 3 deletions gh-actions/retest/retest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,21 @@ class RetestCommand {
retestExternal = async (check: Retest): Promise<any | void> => {
let response: AxiosResponse
if (check.method == 'patch') {
response = await axios.patch(check.url, {}, check.config)
console.log(`CONFIG: ${check.config}`)
console.log(`URL ${check.url}`)
try {
response = await axios.patch(check.url, {}, check.config)
/* eslint-disable prettier/prettier */
} catch (error: any) {
if (!axios.isAxiosError(error) || !error.response) {
console.log('No response received')
return
}
console.log(error.response.data)
console.log(error.response.status)
console.log(error.response.headers)
return
}
} else {
return
}
Expand Down Expand Up @@ -238,14 +252,14 @@ class AZPRetestCommand extends RetestCommand {
const name = `[${subcheck}](${link})`
const config = {
headers: {
Authorization: `Basic ${this.env.azpToken}`,
authorization: `basic ${this.env.azpToken}`,
'content-type': 'application/json;odata=verbose',
},
}
for (const check of subchecks) {
if (check.conclusion && check.conclusion !== 'success') {
const [_, buildId, project] = checkId.split('|')
const url = `https://dev.azure.com/${this.env.azpOrg}/${project}/_apis/build/builds/${buildId}?retry=true&api-version=5.1`
const url = `https://dev.azure.com/${this.env.azpOrg}/${project}/_apis/build/builds/${buildId}?retry=true&api-version=6.0`
retestables.push({
url,
name,
Expand Down

0 comments on commit 8da3476

Please sign in to comment.