Skip to content

Commit

Permalink
Print error in Action log (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
theztefan authored Jul 1, 2024
1 parent 7c99145 commit d437f78
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion action.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {getInput, setFailed} from '@actions/core'
import {getInput, setFailed, error as logerror} from '@actions/core'
import {join, parse} from 'path'
import ActionDetails from './utils/details'
import {context} from '@actions/github'
Expand All @@ -24,6 +24,7 @@ import {context} from '@actions/github'
await ad.getDetails()
// await ad.postComment()
} catch (error) {
logerror(`Error: ${error}.`)
setFailed(error.message)
}
})()
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions utils/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ Please make sure this is intended by providing a business reason via comment bel
Please delete \`${owner}/${repo}\` from \`${this.allowList}\`!`,
position,
)
throw error
}
}
}
Expand Down

0 comments on commit d437f78

Please sign in to comment.