Skip to content

Commit

Permalink
Add info messages to ease debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie committed Oct 23, 2020
1 parent 9dfd79d commit a038353
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ const batch = (size, inputs) => inputs.reduce((batches, input) => {
}, [[]])

const createCheck = async function (octokit, owner, repo, title, ref) {
core.info(`Creating check {owner: "${owner}", repo: "${repo}", name: ${title}}`)
try {
const { data: { id: checkRunId } } = await octokit.checks.create({
owner,
Expand All @@ -322,6 +323,7 @@ const createCheck = async function (octokit, owner, repo, title, ref) {
}

const updateCheck = async function (octokit, owner, repo, checkRunId, conclusion, title, summary, annotations) {
core.info(`Updating check {owner: "${owner}", repo: "${repo}", check_run_id: ${checkRunId}}`)
try {
await octokit.checks.update({
owner,
Expand Down Expand Up @@ -400,6 +402,7 @@ async function run () {
const annotations = JSON.parse(inputContent)
const checkRunId = await createCheck(octokit, owner, repo, title, ref)
const { failureCount, warningCount, noticeCount } = stats(annotations)
core.info(`Found ${failureCount} failure(s), ${warningCount} warning(s) and ${noticeCount} notice(s)`)
const summary = generateSummary(failureCount, warningCount, noticeCount)
const conclusion = generateConclusion(failureCount, warningCount, noticeCount)

Expand Down
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const batch = (size, inputs) => inputs.reduce((batches, input) => {
}, [[]])

const createCheck = async function (octokit, owner, repo, title, ref) {
core.info(`Creating check {owner: "${owner}", repo: "${repo}", name: ${title}}`)
try {
const { data: { id: checkRunId } } = await octokit.checks.create({
owner,
Expand All @@ -49,6 +50,7 @@ const createCheck = async function (octokit, owner, repo, title, ref) {
}

const updateCheck = async function (octokit, owner, repo, checkRunId, conclusion, title, summary, annotations) {
core.info(`Updating check {owner: "${owner}", repo: "${repo}", check_run_id: ${checkRunId}}`)
try {
await octokit.checks.update({
owner,
Expand Down Expand Up @@ -127,6 +129,7 @@ async function run () {
const annotations = JSON.parse(inputContent)
const checkRunId = await createCheck(octokit, owner, repo, title, ref)
const { failureCount, warningCount, noticeCount } = stats(annotations)
core.info(`Found ${failureCount} failure(s), ${warningCount} warning(s) and ${noticeCount} notice(s)`)
const summary = generateSummary(failureCount, warningCount, noticeCount)
const conclusion = generateConclusion(failureCount, warningCount, noticeCount)

Expand Down

0 comments on commit a038353

Please sign in to comment.