Skip to main content

ActionContext

Home > @backstage/plugin-scaffolder-node > ActionContext

ActionContext is passed into scaffolder actions.

Signature:

export type ActionContext<TActionInput extends JsonObject, TActionOutput extends JsonObject = JsonObject> = {
logger: Logger;
logStream: Writable;
secrets?: TaskSecrets;
workspacePath: string;
input: TActionInput;
checkpoint<U extends JsonValue>(key: string, fn: () => Promise<U>): Promise<U>;
output(name: keyof TActionOutput, value: TActionOutput[keyof TActionOutput]): void;
createTemporaryDirectory(): Promise<string>;
getInitiatorCredentials(): Promise<BackstageCredentials>;
templateInfo?: TemplateInfo;
isDryRun?: boolean;
user?: {
entity?: UserEntity;
ref?: string;
};
signal?: AbortSignal;
each?: JsonObject;
};

References: JsonObject, TaskSecrets, JsonValue, BackstageCredentials, TemplateInfo, UserEntity