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

ActionError overview

Error types for GitHub Actions platform.

Added in v1.0.0


Table of contents


errors

ActionApiError (class)

Signature

export declare class ActionApiError

Added in v1.0.0

[TypeId] (property)

Signature

readonly [TypeId]: typeof TypeId

Added in v1.0.0

ActionContextError (class)

Signature

export declare class ActionContextError

Added in v1.0.0

[TypeId] (property)

Signature

readonly [TypeId]: typeof TypeId

Added in v1.0.0

ActionInputError (class)

Signature

export declare class ActionInputError

Added in v1.0.0

[TypeId] (property)

Signature

readonly [TypeId]: typeof TypeId

Added in v1.0.0

ActionOIDCError (class)

Signature

export declare class ActionOIDCError

Added in v1.0.0

[TypeId] (property)

Signature

readonly [TypeId]: typeof TypeId

Added in v1.0.0

ActionSummaryError (class)

Signature

export declare class ActionSummaryError

Added in v1.0.0

[TypeId] (property)

Signature

readonly [TypeId]: typeof TypeId

Added in v1.0.0

failures

ActionFailed (class)

Explicit action failure.

Use this when your action logic determines it should fail. runMain will use the message for setFailed().

Signature

export declare class ActionFailed

Example

if (pr.draft) {
  yield *
    Effect.fail(
      new ActionFailed({
        message: "Cannot merge draft PRs"
      })
    )
}

Added in v1.0.0

[TypeId] (property)

Signature

readonly [TypeId]: typeof TypeId

Added in v1.0.0

InputValidationFailure (class)

Input validation failure.

This is an expected failure when user-provided input doesn’t match the expected schema. runMain will format this nicely for the GitHub UI.

Signature

export declare class InputValidationFailure

Added in v1.0.0

[TypeId] (property)

Signature

readonly [TypeId]: typeof TypeId

Added in v1.0.0

models

ActionError (type alias)

Signature

export type ActionError =
  | ActionInputError
  | ActionContextError
  | ActionApiError
  | ActionOIDCError
  | ActionSummaryError
  | ActionFailure

Added in v1.0.0

ActionFailure (type alias)

Union of failure types that runMain handles specially.

Signature

export type ActionFailure = InputValidationFailure | ActionFailed

Added in v1.0.0

refinements

isActionError

Signature

export declare const isActionError: (u: unknown) => u is ActionError

Added in v1.0.0

isActionFailure

Type guard for failures that runMain knows how to format nicely.

Signature

export declare const isActionFailure: (u: unknown) => u is ActionFailure

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