Skip to main content Link Search Menu Expand Document (external link)

ActionContext overview

ActionContext service for accessing GitHub Actions workflow context.

Provides typed access to:

  • Event information (name, payload)
  • Workflow properties (name, run ID, run number, attempt)
  • Repository context (owner, repo, ref, sha)
  • Actor information
  • GitHub API URLs

Added in v1.0.0


Table of contents


accessors

action

Signature

export declare const action: Effect.Effect<string, never, ActionContext>

Added in v1.0.0

actor

Signature

export declare const actor: Effect.Effect<string, never, ActionContext>

Added in v1.0.0

apiUrl

Signature

export declare const apiUrl: Effect.Effect<string, never, ActionContext>

Added in v1.0.0

eventName

Signature

export declare const eventName: Effect.Effect<string, never, ActionContext>

Added in v1.0.0

graphqlUrl

Signature

export declare const graphqlUrl: Effect.Effect<string, never, ActionContext>

Added in v1.0.0

issue

Signature

export declare const issue: Effect.Effect<IssueContext, ActionContextError, ActionContext>

Added in v1.0.0

job

Signature

export declare const job: Effect.Effect<string, never, ActionContext>

Added in v1.0.0

payload

Signature

export declare const payload: Effect.Effect<Record<string, unknown>, never, ActionContext>

Added in v1.0.0

ref

Signature

export declare const ref: Effect.Effect<string, never, ActionContext>

Added in v1.0.0

repo

Signature

export declare const repo: Effect.Effect<RepoContext, ActionContextError, ActionContext>

Added in v1.0.0

runAttempt

Signature

export declare const runAttempt: Effect.Effect<number, never, ActionContext>

Added in v1.0.0

runId

Signature

export declare const runId: Effect.Effect<number, never, ActionContext>

Added in v1.0.0

runNumber

Signature

export declare const runNumber: Effect.Effect<number, never, ActionContext>

Added in v1.0.0

serverUrl

Signature

export declare const serverUrl: Effect.Effect<string, never, ActionContext>

Added in v1.0.0

sha

Signature

export declare const sha: Effect.Effect<string, never, ActionContext>

Added in v1.0.0

workflow

Signature

export declare const workflow: Effect.Effect<string, never, ActionContext>

Added in v1.0.0

context

ActionContext

Signature

export declare const ActionContext: Tag<ActionContext, ActionContext>

Added in v1.0.0

layers

layer

Signature

export declare const layer: Layer.Layer<ActionContext, never, never>

Added in v1.0.0

models

ActionContext (interface)

Signature

export interface ActionContext {
  readonly [TypeId]: typeof TypeId

  // Event properties
  readonly eventName: string
  readonly payload: Record<string, unknown>

  // Workflow properties
  readonly workflow: string
  readonly action: string
  readonly actor: string
  readonly job: string

  // Run properties
  readonly runId: number
  readonly runNumber: number
  readonly runAttempt: number

  // Ref properties
  readonly ref: string
  readonly sha: string

  // URL properties
  readonly apiUrl: string
  readonly serverUrl: string
  readonly graphqlUrl: string

  // Computed properties
  readonly repo: Effect.Effect<RepoContext, ActionContextError>
  readonly issue: Effect.Effect<IssueContext, ActionContextError>
}

Added in v1.0.0

IssueContext (interface)

Signature

export interface IssueContext {
  readonly owner: string
  readonly repo: string
  readonly number: number
}

Added in v1.0.0

RepoContext (interface)

Signature

export interface RepoContext {
  readonly owner: string
  readonly repo: string
}

Added in v1.0.0

type id

TypeId

Signature

export declare const TypeId: typeof TypeId

Added in v1.0.0

TypeId (type alias)

Signature

export type TypeId = typeof TypeId

Added in v1.0.0