Pr autotest (#6654)

* fix: catch error on submit
This commit is contained in:
NeverBehave
2021-01-10 19:21:58 -05:00
committed by GitHub
parent ceed618573
commit ed57536a96
2 changed files with 11 additions and 8 deletions

View File

@@ -13,7 +13,7 @@ module.exports = ({github, context, core}, body, number) => {
owner: context.repo.owner,
repo: context.repo.repo,
name: noFound
}).catch(() => {});
}).catch((e) => { core.warning(e); });
};
if (m && m[1]) {
@@ -28,7 +28,7 @@ module.exports = ({github, context, core}, body, number) => {
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['Auto: No Route Needed']
});
}).catch((e) => { core.warning(e); });
return;
} else if (res.length > 0) {

View File

@@ -1,3 +1,5 @@
/* eslint-disable */
module.exports = async ({github, context}, baseUrl, routes, number) => {
if (routes[0] === 'NOROUTE') {
return;
@@ -11,9 +13,10 @@ module.exports = async ({github, context}, baseUrl, routes, number) => {
let com = 'Successfully generated as following:\n\n';
for (const lks of links) {
console.log("testing route: ", lks);
const res = await github.request(`GET ${lks}`).catch((err) => {
com += `
console.log("testing route: ", lks)
// Intended, one at a time
const res = await github.request(`GET ${lks}`).catch(err => {
com+= `
<details>
<summary><a href="${lks}">${lks}</a> - **Failed**</summary>
@@ -44,11 +47,11 @@ module.exports = async ({github, context}, baseUrl, routes, number) => {
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['Auto: Route Test Complete']
});
}).catch((e) => { core.warning(e) })
github.issues.createComment({
issue_number: number,
owner: context.repo.owner,
repo: context.repo.repo,
body: com
});
};
}).catch((e) => { core.warning(e) })
}