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();