Skip to content

Commit

Permalink
🩹 Fix bad broken error handling due to bad import (#318)
Browse files Browse the repository at this point in the history
TypeError: Cannot read properties of undefined (reading 'setFailed')
  • Loading branch information
s-weigand authored Jul 8, 2023
1 parent 37605b1 commit 2d505f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import core from '@actions/core'
import { setFailed } from '@actions/core'
import { loadConfig } from './load_config'
import { setup_conda } from './conda_actions'

Expand All @@ -8,9 +8,9 @@ async function run(): Promise<void> {
await setup_conda(config)
} catch (error) {
if (typeof error === 'string') {
core.setFailed(error)
setFailed(error)
} else if (error instanceof Error) {
core.setFailed(error.message)
setFailed(error.message)
}
}
}
Expand Down

0 comments on commit 2d505f2

Please sign in to comment.