mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +00:00
chore: auto-fix lint & formatting [skip ci]
This commit is contained in:
parent
449739ee97
commit
5c31b573d3
2 changed files with 16 additions and 11 deletions
|
|
@ -172,10 +172,12 @@ export async function dispatchEvent(
|
||||||
const showEmoji = group?.emoji !== false;
|
const showEmoji = group?.emoji !== false;
|
||||||
const message = formatEvent(route, event, tr, showEmoji);
|
const message = formatEvent(route, event, tr, showEmoji);
|
||||||
if (event.event === "check_suite") {
|
if (event.event === "check_suite") {
|
||||||
const suite = event.payload.check_suite as {
|
const suite = event.payload.check_suite as
|
||||||
|
| {
|
||||||
conclusion?: string;
|
conclusion?: string;
|
||||||
check_runs_url?: string;
|
check_runs_url?: string;
|
||||||
} | undefined;
|
}
|
||||||
|
| undefined;
|
||||||
if (suite?.conclusion === "failure" && suite.check_runs_url) {
|
if (suite?.conclusion === "failure" && suite.check_runs_url) {
|
||||||
const buildLogUrl = await getCheckSuiteBuildLogUrl(
|
const buildLogUrl = await getCheckSuiteBuildLogUrl(
|
||||||
suite.check_runs_url,
|
suite.check_runs_url,
|
||||||
|
|
|
||||||
|
|
@ -22,14 +22,17 @@ export async function getCheckSuiteBuildLogUrl(
|
||||||
if (!checkRunsUrl || !appId || !privateKey || !installationId) return undefined;
|
if (!checkRunsUrl || !appId || !privateKey || !installationId) return undefined;
|
||||||
try {
|
try {
|
||||||
const jwt = await createAppJwt(appId, privateKey);
|
const jwt = await createAppJwt(appId, privateKey);
|
||||||
const tokRes = await fetch(`https://api.github.com/app/installations/${installationId}/access_tokens`, {
|
const tokRes = await fetch(
|
||||||
|
`https://api.github.com/app/installations/${installationId}/access_tokens`,
|
||||||
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${jwt}`,
|
Authorization: `Bearer ${jwt}`,
|
||||||
Accept: "application/vnd.github+json",
|
Accept: "application/vnd.github+json",
|
||||||
"X-GitHub-Api-Version": API_VERSION,
|
"X-GitHub-Api-Version": API_VERSION,
|
||||||
},
|
},
|
||||||
});
|
},
|
||||||
|
);
|
||||||
if (!tokRes.ok) return undefined;
|
if (!tokRes.ok) return undefined;
|
||||||
const { token } = (await tokRes.json()) as { token?: string };
|
const { token } = (await tokRes.json()) as { token?: string };
|
||||||
if (!token) return undefined;
|
if (!token) return undefined;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue