GitHub Check/PR Status Mapper (github/mappers.ts)

orca · src/main/github/mappers.ts · typescript · MIT
integration, infra, tag:mapping, tag:pull-request

Maps GitHub REST API check-run, commit-status, and PR/issue payloads into normalized internal status/conclusion enums used across the app.

// Source: https://github.com/stablyai/orca | License: MIT | Copyright 2026 Lovecast Inc
// Provided via justclaw.it.com; keep this notice with the code.
import type { PRCheckDetail } from '../../shared/github/check-types'
import type { CheckStatus, IssueInfo, PRInfo } from '../../shared/github/pull-request-types'
import { derivePRCheckStatusFromRollup } from '../../shared/pr-check-status'

// ── REST API check-runs mapping ───────────────────────────────────────
// The REST check-runs endpoint returns separate status + conclusion fields
// (unlike gh pr checks which merges them into a single "state" string).

export function mapCheckRunRESTStatus(status: string): PRCheckDetail['status'] {
  const s = status?.toLowerCase()
  if (s === 'queued') {
    return 'queued'
  }
  if (s === 'in_pro

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key