Skip to main content

Getting started

Use this guide to install the plugin, enable your first preset, and quickly navigate to the rule and preset reference docs.

Installโ€‹

npm install --save-dev eslint eslint-plugin-github-actions-2

Flat config exampleโ€‹

import githubActions from "eslint-plugin-github-actions-2";

export default [githubActions.configs.recommended];

What the presets do for youโ€‹

The exported presets already:

  • scope themselves to .github/workflows/*.{yml,yaml}
  • register yaml-eslint-parser
  • register the github-actions plugin namespace

Choosing a presetโ€‹

  • Start with recommended for most repositories.
  • Add security when you want immutable pinning checks.
  • Use strict when you want concurrency and stronger operational guardrails.
  • Use all to enable every published rule.

For target-specific linting, use:

  • actionMetadata for action.yml/action.yaml
  • workflowTemplates for workflow-templates/*.yml and *.yaml
  • workflowTemplateProperties for workflow-templates/*.properties.json

Next stepsโ€‹