diff --git a/src/index.ts b/src/index.ts index 842bbaf..40aa32c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -14,6 +14,7 @@ export async function run(): Promise { const pullRequestNumber = github.context.payload.pull_request?.number Logger.log('pullRequestNumber', pullRequestNumber) + Logger.log('github.context', github.context) // If the PR number is not found, exit the action if (!pullRequestNumber) { diff --git a/src/steps/post-comment.ts b/src/steps/post-comment.ts index 7e3a40a..6ee5b14 100644 --- a/src/steps/post-comment.ts +++ b/src/steps/post-comment.ts @@ -1,14 +1,17 @@ -import * as core from "@actions/core"; -import * as github from "@actions/github"; +import * as core from '@actions/core' +import * as github from '@actions/github' +import { Logger } from 'src/utils.js' export async function postComment(pullRequestNumber: number, summary: string) { - const githubToken = core.getInput("token"); - const octokit = github.getOctokit(githubToken); - const repo = github.context.repo; + const githubToken = core.getInput('token') + const octokit = github.getOctokit(githubToken) + const repo = github.context.repo + Logger.log('posted comment', github.context) - const { data } = await octokit.rest.pulls.update({ - ...repo, - pull_number: pullRequestNumber, - body: summary - }); + const { data } = await octokit.rest.pulls.update({ + ...repo, + pull_number: pullRequestNumber, + body: summary + }) + Logger.log('posted comment', data.body) }