Skip to content

Commit

Permalink
loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
bemijonathan committed Sep 30, 2023
1 parent 890a301 commit b486bb5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export async function run(): Promise<void> {
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) {
Expand Down
23 changes: 13 additions & 10 deletions src/steps/post-comment.ts
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit b486bb5

Please sign in to comment.