Skip to content

Commit

Permalink
chore: add more logging during execution
Browse files Browse the repository at this point in the history
  • Loading branch information
Chesire committed Apr 3, 2021
1 parent 1a7b535 commit a4ed25c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ async function run() {
if (image === "") {
console.error("No image url found! Not posting a comment")
} else {
console.log(`image url - ${image}`)
postImageToPR(context, image)
}
}
Expand All @@ -37,6 +36,7 @@ async function getAnimalImageUrl() {
const animalInput = core.getInput('animal-type')
const animalType = animalInput.toUpperCase()

console.log("Looking for animal " + animalType)
if (animalType == animal.shiba) {
return getShibaImage()
} else if (animalType == animal.cat) {
Expand Down Expand Up @@ -106,6 +106,8 @@ async function postImageToPR(context, picture) {
const prNumber = context.payload.pull_request.number
const commentBody = `![](${picture})`

console.log("Posting comment " + commentBody)

octokit.issues.createComment({
...context.repo,
issue_number: prNumber,
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ async function run() {
if (image === "") {
console.error("No image url found! Not posting a comment")
} else {
console.log(`image url - ${image}`)
postImageToPR(context, image)
}
}
Expand All @@ -30,6 +29,7 @@ async function getAnimalImageUrl() {
const animalInput = core.getInput('animal-type')
const animalType = animalInput.toUpperCase()

console.log("Looking for animal " + animalType)
if (animalType == animal.shiba) {
return getShibaImage()
} else if (animalType == animal.cat) {
Expand Down Expand Up @@ -99,6 +99,8 @@ async function postImageToPR(context, picture) {
const prNumber = context.payload.pull_request.number
const commentBody = `![](${picture})`

console.log("Posting comment " + commentBody)

octokit.issues.createComment({
...context.repo,
issue_number: prNumber,
Expand Down

0 comments on commit a4ed25c

Please sign in to comment.