Skip to content

github-action/prefer-file-extension ​

Enforce workflow file extension.

  • 💼 This rule is enabled in the ✅ recommended config.

📖 Rule Details ​

This rule reports when a workflow file extension does not match.

yml
# yml.yml
name: Release
correct
yaml
# yaml.yaml
name: Release
incorrect

🔧 Options ​

Default extension is set to yml.

ts
type AllowedExtension = 'yml' | 'yaml'

type PreferFileExtensionOptions = [
  'error' | 'warn' | 'off' | 2 | 1 | 0,
  (
    | AllowedExtension
    | {
        extension?: AllowedExtension
        /**
         * @default true
         */
        caseSensitive?: boolean
      }
  ),
]

"yml" (default) ​

Examples of correct code for this rule with default option:

yml
# yml.yml
name: Release
correct

Examples of incorrect code for this rule with default option:

yaml
# yaml.yaml
name: Release
incorrect

"yaml" ​

Examples of correct code for this rule with "yaml" option:

yaml
# yaml.yaml
name: Release
correct

Examples of incorrect code for this rule with "yaml" option:

yml
# yml.yml
name: Release
incorrect

🚀 Version ​

This rule was introduced in eslint-plugin-github-action v0.0.8

🔍 Implementation ​