Skip to content

Commit

Permalink
chore: Fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 committed Apr 2, 2024
1 parent fa1f66a commit cfcd21a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/gha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export type Steps = {
const PR_REF_REGEX = /^refs\/pull\/(\d+)\/merge$/
const BRANCH_REF_REGEX = /^refs\/heads\/(.+)$/
const TAG_REF_REGEX = /^refs\/tags\/(.+)$/
const DEPENDABOT_REGEX = /^dependabot\/(?:[\w]+)\/([\w/-]+)-([\d]+\.[\d]+\.[\d]+.*)$/
const DEPENDABOT_REGEX =
/^dependabot\/(?:[\w]+)\/([\w/-]+)-([\d]+\.[\d]+\.[\d]+.*)$/

// --

Expand Down
9 changes: 7 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ async function run(): Promise<void> {
const url = process.env.SLACK_WEBHOOK_URL
if (!url) {
core.info(
// eslint-disable-next-line i18n-text/no-en
'No SLACK_WEBHOOK_URL environment variable provided, skipping sending Slack notification.'
)
return
Expand All @@ -17,7 +18,7 @@ async function run(): Promise<void> {
| 'success'
| 'failure'
| 'cancelled'
const env = (process.env as unknown) as GitHubActionsEnv
const env = process.env as unknown as GitHubActionsEnv
core.info(core.getInput('steps'))
if (status === 'success') {
const msg = success(env)
Expand All @@ -27,7 +28,11 @@ async function run(): Promise<void> {
await webhook.send(msg as IncomingWebhookSendArguments)
}
} catch (error) {
core.setFailed(error.message)
if (error instanceof Error) {
core.setFailed(error.message)
} else {
core.setFailed(String(error))
}
}
}

Expand Down

0 comments on commit cfcd21a

Please sign in to comment.