From 7479f74388aff3fbd308205fa4f71b5d22c8673a Mon Sep 17 00:00:00 2001 From: JackyWoo Date: Fri, 13 Sep 2024 16:18:50 +0800 Subject: [PATCH] test ci --- .github/workflows/check-style.yml | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/check-style.yml b/.github/workflows/check-style.yml index eeba3980a3..6b2656bc03 100644 --- a/.github/workflows/check-style.yml +++ b/.github/workflows/check-style.yml @@ -56,27 +56,18 @@ jobs: const testResults = fs.readFileSync('/tmp/style_report.log', 'utf8'); - async function commentOnPR() { - const auth = createAppAuth({ - appId: 995720, - privateKey: fs.readFileSync('/tmp/private-key.pem', 'utf8'), - installationId: 54780428, + const auth = createAppAuth({ + appId: 995720, + privateKey: fs.readFileSync('/tmp/private-key.pem', 'utf8'), + installationId: 54780428, }); - const installationAuthentication = await auth({ type: 'installation' }); - - const octokit = new Octokit({ auth: installationAuthentication.token }); - - try { - await octokit.issues.createComment({ + const octokit = new Octokit({ auth: await auth() }); + + await octokit.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.issue.number, - body: `Integration tests failed. Here are the results:\n\n\`\`\`\n${testResults}\n\`\`\``, + body: `Integration tests failed. Here are the results:\n\n\`\`\`\n${testResults}\n\`\`\`` }); - } catch (error) { - console.error('Error creating comment:', error); - } - } - commentOnPR();