Skip to content

statusToIcon

Maps a CI/CD job status to an emoji icon.

StatusIcon
success✅
failure❌
skipped⏭️
(other)⚠️

Available since v2.0.0

import { statusToIcon } from '@helpers4/ci';
statusToIcon(status: CiStatus): string
ParameterTypeDescription
statusCiStatusThe CI/CD job status

string — An emoji representing the status

Returns an emoji icon matching the given CI status.

statusToIcon('success')  // => '✅'
statusToIcon('failure')  // => '❌'
statusToIcon('skipped')  // => '⏭️'
statusToIcon('pending')  // => '⚠️'

Canonical CI/CD job status values. The string & {} intersection allows any custom status string while still enabling IDE auto-completion for the known values.

type CiStatus = 'success' | 'failure' | 'skipped' | 'unknown' | (string & {})

View source on GitHub