open-index/open-npm huggingface dataset:
npm package: @redhat-actions/action-io-generator
Description: Automatically generate enums for your JavaScript action's inputs and outputs
Author: tetchell@redhat.com
Latest version: 1.5.0

## GitHub Action Input-Output Generator

[![action-io-generator CI](https://github.com/redhat-actions/common/workflows/action-io-generator%20CI/badge.svg)](https://github.com/redhat-actions/common/actions)

[![npm badge](https://img.shields.io/npm/v/@redhat-actions/action-io-generator)](https://www.npmjs.com/package/@redhat-actions/action-io-generator)
[![Tag](https://img.shields.io/github/v/tag/redhat-actions/common)](https://github.com/redhat-actions/common/tags)
[![License](https://img.shields.io/github/license/redhat-actions/common)](./LICENSE)

This is a utility to generate JavaScript/TypeScript enums from an `action.yml` file. It can be invoked as a command-line tool or programmatically.

By using this tool, you can reduce duplication and the errors that come with it by allowing the `action.yml` to work as the single source of truth for your action's inputs and outputs. This reduces the maintainence required to add, edit, and remove inputs or outputs, and ensures everything is named correctly.

## Install

```bash
$ npm i -D @redhat-actions/action-io-generator
```

## Usage
```bash
$ npx action-io-generator --actionYml ./action.yml --outFile ./src/generated/inputs-outputs.ts
Loading action file from ./action.yml
Found 8 inputs and 0 outputs.
Outputting input and output enums to src/generated/inputs-outputs.ts
```

## Example
See [test](./test) for an example. [generated/inputs-outputs.ts](./test/generated/inputs-outputs.ts) is generated from [test.action.yml](/test/test.action.yml).

```yaml
inputs:
  foo:
    required: true
    description: This is the foo input.
    default: foo-default
```

becomes:

```js
export enum Inputs {
    /**
     * This is the foo input.
     * Required: true
     * Default: "foo-default"
     */
    FOO = "foo",
}
```

## Options
The only required option is `-o / --outFile`. For example, `npx action-io-generator -o generated/inputs-outputs.ts`.

| Short | Long | Default | Description |
| ----  | ---- | ------- | ----------- |
| `-o`  | `--outFile` | **None** | JS/TS file to write out enums to. The directory must exist. If the file exists, it is overwritten. |
| `-a`  | `--actionYml` | `./action.yml` | Path to `action.yml` to process into enums. |
| `-s`  | `--silent` | `false` | Produce no output, except errors to stderr. |
| `-w`  | `--watch` | `false` | Keep running after generating once, and re-run the generator each time the `actionYml` is edited. |
npm package: @redhat-actions/eslint-config
Description: ESLint config for GitHub Actions
Author: tetchell@redhat.com
Latest version: 1.3.2

# Redhat Actions ESLint Config

[![eslint-config](https://img.shields.io/npm/v/@redhat-actions/eslint-config?label=@redhat-actions/eslint&logo=eslint&logoColor=red)](https://npmjs.com/@redhat-actions/eslint-config)

## Install
```sh
npm i -D eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin && \
    npm i -D @redhat-actions/eslint-config
```

Then create `.eslintrc.js` with the following contents:
```js
module.exports = {
    extends: [
        "@redhat-actions/eslint-config",
    ],
};
```

This config file includes rules that require the TypeScript types. See [our tsconfig](https://npmjs.com/@redhat-actions/tsconfig).
npm package: @redhat-actions/tsconfig
Description: TS config for Node 12 Red Hat GitHub Actions
Author: tetchell@redhat.com
Latest version: 1.2.0

# Redhat Actions TS Config

[![tsconfig](https://img.shields.io/npm/v/@redhat-actions/tsconfig?label=@redhat-actions/tsconfig&logo=typescript&logoColor=red)](https://npmjs.com/@redhat-actions/tsconfig)

## Install

```sh
npm i -D @redhat-actions/tsconfig
```

Then create `tsconfig.json`:
```json
{
  "extends": "@redhat-actions/tsconfig",
  "compilerOptions": {
    "rootDir": "src/",
    "outDir": "out/"
  },
  "include": [
    "src/"
  ],
}
```

Also see [our ESLint config](https://npmjs.com/@redhat-actions/eslint-config).
npm package: @redhat-actions/webpack-config
Description: Webpack config for Red Hat GitHub Actions
Author: tetchell@redhat.com
Latest version: 1.2.0

# Red Hat Actions Webpack Config

[![webpack config](https://img.shields.io/npm/v/@redhat-actions/webpack-config?label=@redhat-actions/webpack-config)](https://npmjs.com/@redhat-actions/webpack-config)

GitHub Actions tend to use `@vercel/ncc` for bundling due to its ease of use. However, on multiple occasions I've had `ncc` stop working without any obvious way to fix it.

On those projects, I've migrated to `webpack`, so the config is stored here.

# Install

Install peer dependencies:
```sh
npm i -D webpack webpack-cli ts-loader @types/terser-webpack-plugin
```

Install the config:
```sh
npm i -D @redhat-actions/webpack-config
```

Create `webpack.config.js` with the following content:

```js
//@ts-check

module.exports = require("@redhat-actions/webpack-config")(__dirname);
```

If you need to modify/override the config, you can set `module.exports` to a function instead, modify the `require`'d config as necessary, and return the config.