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

Action overview

Combined Action module for GitHub Actions development.

Provides:

  • Combined layer including all services
  • runMain for running actions with proper error handling
  • Convenience type exports

Added in v1.0.0


Table of contents


layers

layer

Layer providing all GitHub Action services.

Signature

export declare const layer: (token: string) => Layer.Layer<ActionRequirements>

Added in v1.0.0

models

ActionRequirements (type alias)

Combined requirements for all GitHub Action services.

Signature

export type ActionRequirements =
  | ActionRunner.ActionRunner
  | ActionContext.ActionContext
  | ActionClient.ActionClient
  | ActionSummary.ActionSummary

Added in v1.0.0

running

RunMainOptions (interface)

Options for runMain.

Signature

export interface RunMainOptions {
  /**
   * Turn off automatic error logging.
   * @default false
   */
  readonly disableErrorReporting?: boolean
  /**
   * Use default logger instead of pretty logger.
   * @default false
   */
  readonly disablePrettyLogger?: boolean
  /**
   * GitHub token for API access. Defaults to GITHUB_TOKEN env var.
   */
  readonly token?: string
}

Added in v1.0.0

makeRuntime

Create a runtime with all GitHub Action services provided.

Useful for advanced use cases where you need more control over execution.

Signature

export declare const makeRuntime: (token: string) => Effect.Effect<Runtime.Runtime<ActionRequirements>, never, never>

Added in v1.0.0

runMain

Run an Effect as a GitHub Action.

This is the main entry point for GitHub Actions built with Effect. Unlike the previous version, this accepts any error type E and handles errors automatically:

  • Errors are logged via Effect’s logging system
  • Known failure types (InputValidationFailure, ActionFailed) are formatted nicely
  • core.setFailed() is called with the error message
  • Exit code is set appropriately (0 for success, 1 for failure)

Signature

export declare const runMain: <E, A>(effect: Effect.Effect<A, E, ActionRequirements>, options?: RunMainOptions) => void

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