Skip to main content

no-subdirectory-template-file-pattern

Rule catalog ID: R062

Targeted pattern scopeโ€‹

filePatterns entries in workflow-template properties metadata.

What this rule reportsโ€‹

Reports patterns containing path separators that target subdirectories.

Why this rule existsโ€‹

Workflow-template filePatterns are intended to match repository-root indicators.

โŒ Incorrectโ€‹

{ "filePatterns": ["^src/package.json$"] }

โœ… Correctโ€‹

{ "filePatterns": ["^package.json$", "^go\\.mod$"] }

Additional examplesโ€‹

For larger repositories, this rule is often enabled together with one of the published presets so violations are caught in pull requests before workflow changes are merged.

ESLint flat config exampleโ€‹

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

export default [
{
files: ["**/*.{yml,yaml}"],
plugins: {
"github-actions": githubActions,
},
rules: {
"github-actions/no-subdirectory-template-file-pattern": "error",
},
},
];

When not to use itโ€‹

You can disable this rule when its policy does not match your repository standards, or when equivalent enforcement is already handled by another policy tool.

Further readingโ€‹