Skip to content

Commit

Permalink
try catch around execAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
fraguada committed Jul 31, 2024
1 parent 00ca5ee commit 3070513
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions dist/index.js

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

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

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,14 @@ const run = async () => {
*/

const { stdout, stderr } = await execAsync(command, shell)
if (stderr !== '' || stderr !== null) {
core.setFailed(stderr)
try {
const { stdout, stderr } = await execAsync(command, shell)
console.log(`stderr: ${stderr}`)
console.log(`stdout: ${stdout}`)
} catch (error) {
core.setFailed(error)
}

console.log(stdout)

core.debug(new Date().toTimeString())
} catch (error) {
// Fail the workflow run if an error occurs
Expand Down

0 comments on commit 3070513

Please sign in to comment.