actions-kit v0.2.8
actions-kit
A tiny toolkit for GitHub Actions.
!WARNING This package is still in development, and can change at any time.
📦 Installation
pnpm install actions-kit
🚀 Usage
This package contains a set of utilities to help you build GitHub Actions.
getSafeValidatedInput
This utility helps you get the input from the action and validate it using Zod's safeParse
method.
import { getSafeValidatedInput } from "actions-kit";
import { z } from "zod";
const schema = z.string().min(1);
const input = getSafeValidatedInput("example_input", schema);
if (input.success) {
console.log("Valid input:", input.data);
} else {
console.error("Validation errors:", input.error);
}
!NOTE There is also exported
getSafeValidatedInputAsync
which is an async version ofgetSafeValidatedInput
.
getSafeValidatedInput
This utility helps you get the input from the action and validate it using Zod's parse
method.
import { getValidatedInput } from "actions-kit";
import { z } from "zod";
const schema = z.string().min(1);
const input = getValidatedInput("example_input", schema);
console.log("Valid input:", input.data);
!NOTE There is also exported
getValidatedInputAsync
which is an async version ofgetValidatedInput
.
📄 License
Published under MIT License.
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
12 months ago