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
getSafeValidatedInputAsyncwhich 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
getValidatedInputAsyncwhich is an async version ofgetValidatedInput.
📄 License
Published under MIT License.
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago