View on GitHub

check-spelling-docs

Documentation for check-spelling

JSON configuration

Background

  1. GitHub workflows and actions are defined using yaml.
  2. The .github/workflows directory is also protected against normal pushes.
  3. Most of the configuration for check-spelling lives in a different directory (typically .github/actions/spelling).
  4. Parsing yaml is moderately painful.
  5. GitHub Reusable workflows would require defining the same sorts of values as the action yaml does, but with new defaults, which is just incredibly painful.
  6. GitHub Runtime doesn't actually expose workflow inputs to combined workflows -- instead one has to manually beg for them.
  7. GitHub APIs themselves tend to yield JSON and the GitHub Action Runtime itself also deals in JSON.

The second to last point means that the action definition is incredibly verbose in places where it shouldn't need to be. The last point means that check-spelling needs a json parser in order to do anything (it uses jq).

Proposal

Instead of having lots of lines of config in the action.yml file, and similar lines in the reusable workflow, I'm contemplating having just one or two configurable items in the action.yml -- mostly the path to the config directory config and the custom_task).

A new file will be added (tentatively config.json) containing the other configuration that used to be defined in action.yml and specified in the workflow.

Progress and Migration

Using toJSON(inputs) allows me to capture the current inputs (and thus greatly simplify the action.yml code).

Benefits


FAQ | Showcase | Event descriptions | Configuration information | Known Issues | Possible features | Deprecations | Release notes | Helpful scripts