0.3.5 • Published 1 month ago

@infra-blocks/github-actions v0.3.5

Weekly downloads
-
License
ISC
Repository
github
Last release
1 month ago

ts-github-actions

This package provides a set of utilities to improve developer UX while writing GitHub Actions in Typescript.

Usage

The entrypoint to a GitHub Action should look like this:

import { getInputs, runActionHandler } from "@infra-blocks/github-actions";
// You are free to use your favorite validation library. We like zod.
import { z } from "zod";

interface Outputs {
  "example-output": string;
}

async function handler(config: {exampleInput: string; bigInput: number}): Promise<Outputs> {
  // The business goes here.
}

runActionHandler(() => {
  const inputs = getInputs("example-input", "bigInput");
  const config = z.object({
    "example-input": z.string(),
    bigInput: z.number()
  }).transform((parsed) => ({
    exampleInput: parsed["example-input"],
    bigInput: parse.bigInput
  })).parse(inputs);
  return handler(config);
});

Development

Repo init

This repository leverages nvm and users should have it installed in their local environment. In addition, it is recommended that users install a shell hook so that nvm use is run upon changing into a project that utilises nvm.

Upon checking out the repository, run the following commands:

nvm install
npm install
npm run compile
npm run lint
npm run test

Package publication

This package leverages the npm-publish-from-label action as a turnkey, automated mechanism for publishing packages. Refer to its documentation to understand its capabilities.

Packages should therefore not be published manually, as these tasks are automated by the CI.

0.3.5-alpha.1

1 month ago

0.3.5-alpha.0

1 month ago

0.3.5

1 month ago

0.4.0-alpha.1

2 months ago

0.3.4-alpha.0

2 months ago

0.3.4

2 months ago

0.3.3-alpha.0

2 months ago

0.3.3

2 months ago

0.3.2-alpha.0

2 months ago

0.3.2

2 months ago

0.3.1-alpha.0

2 months ago

0.3.1-alpha.1

2 months ago

0.3.1

2 months ago

0.3.0

4 months ago

0.4.0-alpha.0

4 months ago

0.3.0-alpha.0

4 months ago

0.2.1

5 months ago

0.2.1-alpha.0

5 months ago

0.2.0

5 months ago

0.1.0

5 months ago