diff --git a/src/gha.ts b/src/gha.ts index fec0c15..e7773eb 100644 --- a/src/gha.ts +++ b/src/gha.ts @@ -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]+.*)$/ // -- diff --git a/src/main.ts b/src/main.ts index 71e89a2..339c836 100644 --- a/src/main.ts +++ b/src/main.ts @@ -8,6 +8,7 @@ async function run(): Promise { 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 @@ -17,7 +18,7 @@ async function run(): Promise { | '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) @@ -27,7 +28,11 @@ async function run(): Promise { 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)) + } } }