spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / telemetry / hooks / context / environment-fields-of / github-actions-fields-of / github-actions-fields-of.ts
26 lines · 777 BRaw
1import type { Facts } from '../../../facts'
2import type EnvironmentFields from '../../environment-fields'
3
4/**
5 * The GitHub Actions ids for the row's `env` block; undefined when the
6 * workflow names none of the three.
7 *
8 * @param facts the variables as read once for the session
9 * @returns the ids, or undefined
10 */
11export function githubActionsFieldsOf(
12 facts: Facts,
13): EnvironmentFields.GithubActionsFields | undefined {
14 const hasAny =
15 facts.githubActorId !== undefined ||
16 facts.githubRepositoryId !== undefined ||
17 facts.githubRepositoryOwnerId !== undefined
18
19 return hasAny
20 ? {
21 actorId: facts.githubActorId,
22 repositoryId: facts.githubRepositoryId,
23 repositoryOwnerId: facts.githubRepositoryOwnerId,
24 }
25 : undefined
26}