eslint-plugin-github-actions-2 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +164 -0
- package/dist/_internal/case-police-dictionary.d.ts +10 -0
- package/dist/_internal/case-police-dictionary.d.ts.map +1 -0
- package/dist/_internal/case-police-dictionary.js +486 -0
- package/dist/_internal/case-police-dictionary.js.map +1 -0
- package/dist/_internal/casing.d.ts +17 -0
- package/dist/_internal/casing.d.ts.map +1 -0
- package/dist/_internal/casing.js +197 -0
- package/dist/_internal/casing.js.map +1 -0
- package/dist/_internal/github-actions-config-references.d.ts +16 -0
- package/dist/_internal/github-actions-config-references.d.ts.map +1 -0
- package/dist/_internal/github-actions-config-references.js +76 -0
- package/dist/_internal/github-actions-config-references.js.map +1 -0
- package/dist/_internal/github-actions-trigger-events.d.ts +13 -0
- package/dist/_internal/github-actions-trigger-events.d.ts.map +1 -0
- package/dist/_internal/github-actions-trigger-events.js +47 -0
- package/dist/_internal/github-actions-trigger-events.js.map +1 -0
- package/dist/_internal/github-expressions.d.ts +9 -0
- package/dist/_internal/github-expressions.d.ts.map +1 -0
- package/dist/_internal/github-expressions.js +87 -0
- package/dist/_internal/github-expressions.js.map +1 -0
- package/dist/_internal/lint-targets.d.ts +21 -0
- package/dist/_internal/lint-targets.d.ts.map +1 -0
- package/dist/_internal/lint-targets.js +60 -0
- package/dist/_internal/lint-targets.js.map +1 -0
- package/dist/_internal/rule-docs.d.ts +16 -0
- package/dist/_internal/rule-docs.d.ts.map +1 -0
- package/dist/_internal/rule-docs.js +2 -0
- package/dist/_internal/rule-docs.js.map +1 -0
- package/dist/_internal/rules-registry.d.ts +145 -0
- package/dist/_internal/rules-registry.d.ts.map +1 -0
- package/dist/_internal/rules-registry.js +144 -0
- package/dist/_internal/rules-registry.js.map +1 -0
- package/dist/_internal/workflow-template-properties.d.ts +20 -0
- package/dist/_internal/workflow-template-properties.d.ts.map +1 -0
- package/dist/_internal/workflow-template-properties.js +44 -0
- package/dist/_internal/workflow-template-properties.js.map +1 -0
- package/dist/_internal/workflow-yaml.d.ts +47 -0
- package/dist/_internal/workflow-yaml.d.ts.map +1 -0
- package/dist/_internal/workflow-yaml.js +140 -0
- package/dist/_internal/workflow-yaml.js.map +1 -0
- package/dist/_internal/yaml-traversal.d.ts +10 -0
- package/dist/_internal/yaml-traversal.d.ts.map +1 -0
- package/dist/_internal/yaml-traversal.js +38 -0
- package/dist/_internal/yaml-traversal.js.map +1 -0
- package/dist/plugin.cjs +7107 -0
- package/dist/plugin.cjs.map +7 -0
- package/dist/plugin.d.cts +34 -0
- package/dist/plugin.d.ts +34 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +122 -0
- package/dist/plugin.js.map +1 -0
- package/dist/rules/action-name-casing.d.ts +9 -0
- package/dist/rules/action-name-casing.d.ts.map +1 -0
- package/dist/rules/action-name-casing.js +141 -0
- package/dist/rules/action-name-casing.js.map +1 -0
- package/dist/rules/job-id-casing.d.ts +9 -0
- package/dist/rules/job-id-casing.d.ts.map +1 -0
- package/dist/rules/job-id-casing.js +123 -0
- package/dist/rules/job-id-casing.js.map +1 -0
- package/dist/rules/max-jobs-per-action.d.ts +9 -0
- package/dist/rules/max-jobs-per-action.d.ts.map +1 -0
- package/dist/rules/max-jobs-per-action.js +61 -0
- package/dist/rules/max-jobs-per-action.js.map +1 -0
- package/dist/rules/no-case-insensitive-input-id-collision.d.ts +9 -0
- package/dist/rules/no-case-insensitive-input-id-collision.d.ts.map +1 -0
- package/dist/rules/no-case-insensitive-input-id-collision.js +66 -0
- package/dist/rules/no-case-insensitive-input-id-collision.js.map +1 -0
- package/dist/rules/no-composite-input-env-access.d.ts +9 -0
- package/dist/rules/no-composite-input-env-access.d.ts.map +1 -0
- package/dist/rules/no-composite-input-env-access.js +62 -0
- package/dist/rules/no-composite-input-env-access.js.map +1 -0
- package/dist/rules/no-deprecated-node-runtime.d.ts +9 -0
- package/dist/rules/no-deprecated-node-runtime.d.ts.map +1 -0
- package/dist/rules/no-deprecated-node-runtime.js +59 -0
- package/dist/rules/no-deprecated-node-runtime.js.map +1 -0
- package/dist/rules/no-duplicate-composite-step-id.d.ts +9 -0
- package/dist/rules/no-duplicate-composite-step-id.d.ts.map +1 -0
- package/dist/rules/no-duplicate-composite-step-id.js +74 -0
- package/dist/rules/no-duplicate-composite-step-id.js.map +1 -0
- package/dist/rules/no-empty-template-file-pattern.d.ts +9 -0
- package/dist/rules/no-empty-template-file-pattern.d.ts.map +1 -0
- package/dist/rules/no-empty-template-file-pattern.js +49 -0
- package/dist/rules/no-empty-template-file-pattern.js.map +1 -0
- package/dist/rules/no-external-job.d.ts +9 -0
- package/dist/rules/no-external-job.d.ts.map +1 -0
- package/dist/rules/no-external-job.js +49 -0
- package/dist/rules/no-external-job.js.map +1 -0
- package/dist/rules/no-hardcoded-default-branch-in-template.d.ts +9 -0
- package/dist/rules/no-hardcoded-default-branch-in-template.d.ts.map +1 -0
- package/dist/rules/no-hardcoded-default-branch-in-template.js +54 -0
- package/dist/rules/no-hardcoded-default-branch-in-template.js.map +1 -0
- package/dist/rules/no-icon-file-extension-in-template-icon-name.d.ts +9 -0
- package/dist/rules/no-icon-file-extension-in-template-icon-name.d.ts.map +1 -0
- package/dist/rules/no-icon-file-extension-in-template-icon-name.js +54 -0
- package/dist/rules/no-icon-file-extension-in-template-icon-name.js.map +1 -0
- package/dist/rules/no-inherit-secrets.d.ts +9 -0
- package/dist/rules/no-inherit-secrets.d.ts.map +1 -0
- package/dist/rules/no-inherit-secrets.js +57 -0
- package/dist/rules/no-inherit-secrets.js.map +1 -0
- package/dist/rules/no-invalid-concurrency-context.d.ts +9 -0
- package/dist/rules/no-invalid-concurrency-context.d.ts.map +1 -0
- package/dist/rules/no-invalid-concurrency-context.js +141 -0
- package/dist/rules/no-invalid-concurrency-context.js.map +1 -0
- package/dist/rules/no-invalid-key.d.ts +9 -0
- package/dist/rules/no-invalid-key.d.ts.map +1 -0
- package/dist/rules/no-invalid-key.js +152 -0
- package/dist/rules/no-invalid-key.js.map +1 -0
- package/dist/rules/no-invalid-reusable-workflow-job-key.d.ts +9 -0
- package/dist/rules/no-invalid-reusable-workflow-job-key.d.ts.map +1 -0
- package/dist/rules/no-invalid-reusable-workflow-job-key.js +73 -0
- package/dist/rules/no-invalid-reusable-workflow-job-key.js.map +1 -0
- package/dist/rules/no-invalid-template-file-pattern-regex.d.ts +9 -0
- package/dist/rules/no-invalid-template-file-pattern-regex.d.ts.map +1 -0
- package/dist/rules/no-invalid-template-file-pattern-regex.js +58 -0
- package/dist/rules/no-invalid-template-file-pattern-regex.js.map +1 -0
- package/dist/rules/no-invalid-workflow-call-output-value.d.ts +9 -0
- package/dist/rules/no-invalid-workflow-call-output-value.d.ts.map +1 -0
- package/dist/rules/no-invalid-workflow-call-output-value.js +99 -0
- package/dist/rules/no-invalid-workflow-call-output-value.js.map +1 -0
- package/dist/rules/no-path-separators-in-template-icon-name.d.ts +9 -0
- package/dist/rules/no-path-separators-in-template-icon-name.d.ts.map +1 -0
- package/dist/rules/no-path-separators-in-template-icon-name.js +52 -0
- package/dist/rules/no-path-separators-in-template-icon-name.js.map +1 -0
- package/dist/rules/no-post-if-without-post.d.ts +9 -0
- package/dist/rules/no-post-if-without-post.d.ts.map +1 -0
- package/dist/rules/no-post-if-without-post.js +52 -0
- package/dist/rules/no-post-if-without-post.js.map +1 -0
- package/dist/rules/no-pr-head-checkout-in-pull-request-target.d.ts +12 -0
- package/dist/rules/no-pr-head-checkout-in-pull-request-target.d.ts.map +1 -0
- package/dist/rules/no-pr-head-checkout-in-pull-request-target.js +89 -0
- package/dist/rules/no-pr-head-checkout-in-pull-request-target.js.map +1 -0
- package/dist/rules/no-pre-if-without-pre.d.ts +9 -0
- package/dist/rules/no-pre-if-without-pre.d.ts.map +1 -0
- package/dist/rules/no-pre-if-without-pre.js +51 -0
- package/dist/rules/no-pre-if-without-pre.js.map +1 -0
- package/dist/rules/no-required-input-with-default.d.ts +9 -0
- package/dist/rules/no-required-input-with-default.d.ts.map +1 -0
- package/dist/rules/no-required-input-with-default.js +68 -0
- package/dist/rules/no-required-input-with-default.js.map +1 -0
- package/dist/rules/no-secrets-in-if.d.ts +9 -0
- package/dist/rules/no-secrets-in-if.d.ts.map +1 -0
- package/dist/rules/no-secrets-in-if.js +84 -0
- package/dist/rules/no-secrets-in-if.js.map +1 -0
- package/dist/rules/no-self-hosted-runner-on-fork-pr-events.d.ts +9 -0
- package/dist/rules/no-self-hosted-runner-on-fork-pr-events.d.ts.map +1 -0
- package/dist/rules/no-self-hosted-runner-on-fork-pr-events.js +93 -0
- package/dist/rules/no-self-hosted-runner-on-fork-pr-events.js.map +1 -0
- package/dist/rules/no-subdirectory-template-file-pattern.d.ts +9 -0
- package/dist/rules/no-subdirectory-template-file-pattern.d.ts.map +1 -0
- package/dist/rules/no-subdirectory-template-file-pattern.js +52 -0
- package/dist/rules/no-subdirectory-template-file-pattern.js.map +1 -0
- package/dist/rules/no-template-placeholder-in-non-template-workflow.d.ts +9 -0
- package/dist/rules/no-template-placeholder-in-non-template-workflow.d.ts.map +1 -0
- package/dist/rules/no-template-placeholder-in-non-template-workflow.js +55 -0
- package/dist/rules/no-template-placeholder-in-non-template-workflow.js.map +1 -0
- package/dist/rules/no-top-level-env.d.ts +9 -0
- package/dist/rules/no-top-level-env.d.ts.map +1 -0
- package/dist/rules/no-top-level-env.js +42 -0
- package/dist/rules/no-top-level-env.js.map +1 -0
- package/dist/rules/no-top-level-permissions.d.ts +9 -0
- package/dist/rules/no-top-level-permissions.d.ts.map +1 -0
- package/dist/rules/no-top-level-permissions.js +39 -0
- package/dist/rules/no-top-level-permissions.js.map +1 -0
- package/dist/rules/no-universal-template-file-pattern.d.ts +9 -0
- package/dist/rules/no-universal-template-file-pattern.d.ts.map +1 -0
- package/dist/rules/no-universal-template-file-pattern.js +60 -0
- package/dist/rules/no-universal-template-file-pattern.js.map +1 -0
- package/dist/rules/no-unknown-input-reference-in-composite.d.ts +9 -0
- package/dist/rules/no-unknown-input-reference-in-composite.d.ts.map +1 -0
- package/dist/rules/no-unknown-input-reference-in-composite.js +80 -0
- package/dist/rules/no-unknown-input-reference-in-composite.js.map +1 -0
- package/dist/rules/no-unknown-job-output-reference.d.ts +9 -0
- package/dist/rules/no-unknown-job-output-reference.d.ts.map +1 -0
- package/dist/rules/no-unknown-job-output-reference.js +229 -0
- package/dist/rules/no-unknown-job-output-reference.js.map +1 -0
- package/dist/rules/no-unknown-step-reference.d.ts +9 -0
- package/dist/rules/no-unknown-step-reference.d.ts.map +1 -0
- package/dist/rules/no-unknown-step-reference.js +133 -0
- package/dist/rules/no-unknown-step-reference.js.map +1 -0
- package/dist/rules/no-untrusted-input-in-run.d.ts +9 -0
- package/dist/rules/no-untrusted-input-in-run.d.ts.map +1 -0
- package/dist/rules/no-untrusted-input-in-run.js +115 -0
- package/dist/rules/no-untrusted-input-in-run.js.map +1 -0
- package/dist/rules/no-unused-input-in-composite.d.ts +9 -0
- package/dist/rules/no-unused-input-in-composite.d.ts.map +1 -0
- package/dist/rules/no-unused-input-in-composite.js +78 -0
- package/dist/rules/no-unused-input-in-composite.js.map +1 -0
- package/dist/rules/no-write-all-permissions.d.ts +9 -0
- package/dist/rules/no-write-all-permissions.d.ts.map +1 -0
- package/dist/rules/no-write-all-permissions.js +61 -0
- package/dist/rules/no-write-all-permissions.js.map +1 -0
- package/dist/rules/pin-action-shas.d.ts +12 -0
- package/dist/rules/pin-action-shas.d.ts.map +1 -0
- package/dist/rules/pin-action-shas.js +100 -0
- package/dist/rules/pin-action-shas.js.map +1 -0
- package/dist/rules/prefer-action-yml.d.ts +9 -0
- package/dist/rules/prefer-action-yml.d.ts.map +1 -0
- package/dist/rules/prefer-action-yml.js +37 -0
- package/dist/rules/prefer-action-yml.js.map +1 -0
- package/dist/rules/prefer-fail-fast.d.ts +9 -0
- package/dist/rules/prefer-fail-fast.d.ts.map +1 -0
- package/dist/rules/prefer-fail-fast.js +61 -0
- package/dist/rules/prefer-fail-fast.js.map +1 -0
- package/dist/rules/prefer-file-extension.d.ts +9 -0
- package/dist/rules/prefer-file-extension.d.ts.map +1 -0
- package/dist/rules/prefer-file-extension.js +104 -0
- package/dist/rules/prefer-file-extension.js.map +1 -0
- package/dist/rules/prefer-inputs-context.d.ts +9 -0
- package/dist/rules/prefer-inputs-context.d.ts.map +1 -0
- package/dist/rules/prefer-inputs-context.js +91 -0
- package/dist/rules/prefer-inputs-context.js.map +1 -0
- package/dist/rules/prefer-step-uses-style.d.ts +9 -0
- package/dist/rules/prefer-step-uses-style.d.ts.map +1 -0
- package/dist/rules/prefer-step-uses-style.js +209 -0
- package/dist/rules/prefer-step-uses-style.js.map +1 -0
- package/dist/rules/prefer-template-yml-extension.d.ts +9 -0
- package/dist/rules/prefer-template-yml-extension.d.ts.map +1 -0
- package/dist/rules/prefer-template-yml-extension.js +41 -0
- package/dist/rules/prefer-template-yml-extension.js.map +1 -0
- package/dist/rules/require-action-name.d.ts +9 -0
- package/dist/rules/require-action-name.d.ts.map +1 -0
- package/dist/rules/require-action-name.js +57 -0
- package/dist/rules/require-action-name.js.map +1 -0
- package/dist/rules/require-action-run-name.d.ts +9 -0
- package/dist/rules/require-action-run-name.d.ts.map +1 -0
- package/dist/rules/require-action-run-name.js +56 -0
- package/dist/rules/require-action-run-name.js.map +1 -0
- package/dist/rules/require-checkout-before-local-action.d.ts +9 -0
- package/dist/rules/require-checkout-before-local-action.d.ts.map +1 -0
- package/dist/rules/require-checkout-before-local-action.js +74 -0
- package/dist/rules/require-checkout-before-local-action.js.map +1 -0
- package/dist/rules/require-composite-step-name.d.ts +9 -0
- package/dist/rules/require-composite-step-name.d.ts.map +1 -0
- package/dist/rules/require-composite-step-name.js +67 -0
- package/dist/rules/require-composite-step-name.js.map +1 -0
- package/dist/rules/require-job-name.d.ts +9 -0
- package/dist/rules/require-job-name.d.ts.map +1 -0
- package/dist/rules/require-job-name.js +70 -0
- package/dist/rules/require-job-name.js.map +1 -0
- package/dist/rules/require-job-step-name.d.ts +9 -0
- package/dist/rules/require-job-step-name.d.ts.map +1 -0
- package/dist/rules/require-job-step-name.js +71 -0
- package/dist/rules/require-job-step-name.js.map +1 -0
- package/dist/rules/require-job-timeout-minutes.d.ts +9 -0
- package/dist/rules/require-job-timeout-minutes.d.ts.map +1 -0
- package/dist/rules/require-job-timeout-minutes.js +99 -0
- package/dist/rules/require-job-timeout-minutes.js.map +1 -0
- package/dist/rules/require-merge-group-trigger.d.ts +9 -0
- package/dist/rules/require-merge-group-trigger.d.ts.map +1 -0
- package/dist/rules/require-merge-group-trigger.js +65 -0
- package/dist/rules/require-merge-group-trigger.js.map +1 -0
- package/dist/rules/require-pull-request-target-branches.d.ts +9 -0
- package/dist/rules/require-pull-request-target-branches.d.ts.map +1 -0
- package/dist/rules/require-pull-request-target-branches.js +102 -0
- package/dist/rules/require-pull-request-target-branches.js.map +1 -0
- package/dist/rules/require-run-step-shell.d.ts +9 -0
- package/dist/rules/require-run-step-shell.d.ts.map +1 -0
- package/dist/rules/require-run-step-shell.js +114 -0
- package/dist/rules/require-run-step-shell.js.map +1 -0
- package/dist/rules/require-template-categories.d.ts +9 -0
- package/dist/rules/require-template-categories.d.ts.map +1 -0
- package/dist/rules/require-template-categories.js +55 -0
- package/dist/rules/require-template-categories.js.map +1 -0
- package/dist/rules/require-template-file-patterns.d.ts +9 -0
- package/dist/rules/require-template-file-patterns.d.ts.map +1 -0
- package/dist/rules/require-template-file-patterns.js +55 -0
- package/dist/rules/require-template-file-patterns.js.map +1 -0
- package/dist/rules/require-template-icon-file-exists.d.ts +9 -0
- package/dist/rules/require-template-icon-file-exists.d.ts.map +1 -0
- package/dist/rules/require-template-icon-file-exists.js +61 -0
- package/dist/rules/require-template-icon-file-exists.js.map +1 -0
- package/dist/rules/require-template-icon-name.d.ts +9 -0
- package/dist/rules/require-template-icon-name.d.ts.map +1 -0
- package/dist/rules/require-template-icon-name.js +48 -0
- package/dist/rules/require-template-icon-name.js.map +1 -0
- package/dist/rules/require-template-workflow-name.d.ts +9 -0
- package/dist/rules/require-template-workflow-name.d.ts.map +1 -0
- package/dist/rules/require-template-workflow-name.js +48 -0
- package/dist/rules/require-template-workflow-name.js.map +1 -0
- package/dist/rules/require-trigger-types.d.ts +9 -0
- package/dist/rules/require-trigger-types.d.ts.map +1 -0
- package/dist/rules/require-trigger-types.js +126 -0
- package/dist/rules/require-trigger-types.js.map +1 -0
- package/dist/rules/require-workflow-call-input-type.d.ts +9 -0
- package/dist/rules/require-workflow-call-input-type.d.ts.map +1 -0
- package/dist/rules/require-workflow-call-input-type.js +89 -0
- package/dist/rules/require-workflow-call-input-type.js.map +1 -0
- package/dist/rules/require-workflow-call-output-value.d.ts +9 -0
- package/dist/rules/require-workflow-call-output-value.d.ts.map +1 -0
- package/dist/rules/require-workflow-call-output-value.js +79 -0
- package/dist/rules/require-workflow-call-output-value.js.map +1 -0
- package/dist/rules/require-workflow-concurrency.d.ts +9 -0
- package/dist/rules/require-workflow-concurrency.d.ts.map +1 -0
- package/dist/rules/require-workflow-concurrency.js +157 -0
- package/dist/rules/require-workflow-concurrency.js.map +1 -0
- package/dist/rules/require-workflow-dispatch-input-type.d.ts +9 -0
- package/dist/rules/require-workflow-dispatch-input-type.d.ts.map +1 -0
- package/dist/rules/require-workflow-dispatch-input-type.js +80 -0
- package/dist/rules/require-workflow-dispatch-input-type.js.map +1 -0
- package/dist/rules/require-workflow-interface-description.d.ts +9 -0
- package/dist/rules/require-workflow-interface-description.d.ts.map +1 -0
- package/dist/rules/require-workflow-interface-description.js +98 -0
- package/dist/rules/require-workflow-interface-description.js.map +1 -0
- package/dist/rules/require-workflow-permissions.d.ts +9 -0
- package/dist/rules/require-workflow-permissions.d.ts.map +1 -0
- package/dist/rules/require-workflow-permissions.js +83 -0
- package/dist/rules/require-workflow-permissions.js.map +1 -0
- package/dist/rules/require-workflow-run-branches.d.ts +9 -0
- package/dist/rules/require-workflow-run-branches.d.ts.map +1 -0
- package/dist/rules/require-workflow-run-branches.js +84 -0
- package/dist/rules/require-workflow-run-branches.js.map +1 -0
- package/dist/rules/require-workflow-template-pair.d.ts +9 -0
- package/dist/rules/require-workflow-template-pair.d.ts.map +1 -0
- package/dist/rules/require-workflow-template-pair.js +47 -0
- package/dist/rules/require-workflow-template-pair.js.map +1 -0
- package/dist/rules/require-workflow-template-properties-pair.d.ts +9 -0
- package/dist/rules/require-workflow-template-properties-pair.d.ts.map +1 -0
- package/dist/rules/require-workflow-template-properties-pair.js +49 -0
- package/dist/rules/require-workflow-template-properties-pair.js.map +1 -0
- package/dist/rules/valid-timeout-minutes.d.ts +9 -0
- package/dist/rules/valid-timeout-minutes.d.ts.map +1 -0
- package/dist/rules/valid-timeout-minutes.js +255 -0
- package/dist/rules/valid-timeout-minutes.js.map +1 -0
- package/dist/rules/valid-trigger-events.d.ts +9 -0
- package/dist/rules/valid-trigger-events.d.ts.map +1 -0
- package/dist/rules/valid-trigger-events.js +100 -0
- package/dist/rules/valid-trigger-events.js.map +1 -0
- package/docs/rules/action-name-casing.md +64 -0
- package/docs/rules/getting-started.md +46 -0
- package/docs/rules/job-id-casing.md +73 -0
- package/docs/rules/max-jobs-per-action.md +79 -0
- package/docs/rules/no-case-insensitive-input-id-collision.md +63 -0
- package/docs/rules/no-composite-input-env-access.md +66 -0
- package/docs/rules/no-deprecated-node-runtime.md +61 -0
- package/docs/rules/no-duplicate-composite-step-id.md +73 -0
- package/docs/rules/no-empty-template-file-pattern.md +57 -0
- package/docs/rules/no-external-job.md +66 -0
- package/docs/rules/no-hardcoded-default-branch-in-template.md +63 -0
- package/docs/rules/no-icon-file-extension-in-template-icon-name.md +57 -0
- package/docs/rules/no-inherit-secrets.md +65 -0
- package/docs/rules/no-invalid-concurrency-context.md +101 -0
- package/docs/rules/no-invalid-key.md +86 -0
- package/docs/rules/no-invalid-reusable-workflow-job-key.md +74 -0
- package/docs/rules/no-invalid-template-file-pattern-regex.md +57 -0
- package/docs/rules/no-invalid-workflow-call-output-value.md +80 -0
- package/docs/rules/no-path-separators-in-template-icon-name.md +57 -0
- package/docs/rules/no-post-if-without-post.md +64 -0
- package/docs/rules/no-pr-head-checkout-in-pull-request-target.md +83 -0
- package/docs/rules/no-pre-if-without-pre.md +64 -0
- package/docs/rules/no-required-input-with-default.md +64 -0
- package/docs/rules/no-secrets-in-if.md +70 -0
- package/docs/rules/no-self-hosted-runner-on-fork-pr-events.md +75 -0
- package/docs/rules/no-subdirectory-template-file-pattern.md +57 -0
- package/docs/rules/no-template-placeholder-in-non-template-workflow.md +63 -0
- package/docs/rules/no-top-level-env.md +64 -0
- package/docs/rules/no-top-level-permissions.md +64 -0
- package/docs/rules/no-universal-template-file-pattern.md +57 -0
- package/docs/rules/no-unknown-input-reference-in-composite.md +71 -0
- package/docs/rules/no-unknown-job-output-reference.md +88 -0
- package/docs/rules/no-unknown-step-reference.md +73 -0
- package/docs/rules/no-untrusted-input-in-run.md +74 -0
- package/docs/rules/no-unused-input-in-composite.md +71 -0
- package/docs/rules/no-write-all-permissions.md +60 -0
- package/docs/rules/overview.md +91 -0
- package/docs/rules/pin-action-shas.md +65 -0
- package/docs/rules/prefer-action-yml.md +57 -0
- package/docs/rules/prefer-fail-fast.md +72 -0
- package/docs/rules/prefer-file-extension.md +77 -0
- package/docs/rules/prefer-inputs-context.md +84 -0
- package/docs/rules/prefer-step-uses-style.md +70 -0
- package/docs/rules/prefer-template-yml-extension.md +57 -0
- package/docs/rules/presets/action-metadata.md +18 -0
- package/docs/rules/presets/all.md +76 -0
- package/docs/rules/presets/index.md +100 -0
- package/docs/rules/presets/recommended.md +26 -0
- package/docs/rules/presets/security.md +16 -0
- package/docs/rules/presets/strict.md +48 -0
- package/docs/rules/presets/workflow-template-properties.md +18 -0
- package/docs/rules/presets/workflow-templates.md +22 -0
- package/docs/rules/require-action-name.md +61 -0
- package/docs/rules/require-action-run-name.md +63 -0
- package/docs/rules/require-checkout-before-local-action.md +66 -0
- package/docs/rules/require-composite-step-name.md +66 -0
- package/docs/rules/require-job-name.md +63 -0
- package/docs/rules/require-job-step-name.md +69 -0
- package/docs/rules/require-job-timeout-minutes.md +76 -0
- package/docs/rules/require-merge-group-trigger.md +67 -0
- package/docs/rules/require-pull-request-target-branches.md +79 -0
- package/docs/rules/require-run-step-shell.md +85 -0
- package/docs/rules/require-template-categories.md +62 -0
- package/docs/rules/require-template-file-patterns.md +63 -0
- package/docs/rules/require-template-icon-file-exists.md +61 -0
- package/docs/rules/require-template-icon-name.md +57 -0
- package/docs/rules/require-template-workflow-name.md +60 -0
- package/docs/rules/require-trigger-types.md +76 -0
- package/docs/rules/require-workflow-call-input-type.md +70 -0
- package/docs/rules/require-workflow-call-output-value.md +67 -0
- package/docs/rules/require-workflow-concurrency.md +73 -0
- package/docs/rules/require-workflow-dispatch-input-type.md +70 -0
- package/docs/rules/require-workflow-interface-description.md +96 -0
- package/docs/rules/require-workflow-permissions.md +75 -0
- package/docs/rules/require-workflow-run-branches.md +66 -0
- package/docs/rules/require-workflow-template-pair.md +58 -0
- package/docs/rules/require-workflow-template-properties-pair.md +58 -0
- package/docs/rules/valid-timeout-minutes.md +74 -0
- package/docs/rules/valid-trigger-events.md +62 -0
- package/package.json +497 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# no-post-if-without-post
|
|
2
|
+
|
|
3
|
+
> **Rule catalog ID:** R046
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
Action metadata `runs.post-if` declarations.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
Reports `runs.post-if` when `runs.post` is missing.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
`post-if` has no effect without a matching `post` hook.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
runs:
|
|
21
|
+
using: node20
|
|
22
|
+
main: dist/index.js
|
|
23
|
+
post-if: runner.os == 'Linux'
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ✅ Correct
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
runs:
|
|
30
|
+
using: node20
|
|
31
|
+
main: dist/index.js
|
|
32
|
+
post: dist/cleanup.js
|
|
33
|
+
post-if: runner.os == 'Linux'
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## Additional examples
|
|
38
|
+
|
|
39
|
+
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.
|
|
40
|
+
|
|
41
|
+
## ESLint flat config example
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import githubActions from "eslint-plugin-github-actions-2";
|
|
45
|
+
|
|
46
|
+
export default [
|
|
47
|
+
{
|
|
48
|
+
files: ["**/*.{yml,yaml}"],
|
|
49
|
+
plugins: {
|
|
50
|
+
"github-actions": githubActions,
|
|
51
|
+
},
|
|
52
|
+
rules: {
|
|
53
|
+
"github-actions/no-post-if-without-post": "error",
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## When not to use it
|
|
60
|
+
|
|
61
|
+
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.
|
|
62
|
+
## Further reading
|
|
63
|
+
|
|
64
|
+
- [https://docs.github.com/actions/reference/workflows-and-actions/metadata-syntax#runs-for-javascript-actions](https://docs.github.com/actions/reference/workflows-and-actions/metadata-syntax#runs-for-javascript-actions)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# no-pr-head-checkout-in-pull-request-target
|
|
2
|
+
|
|
3
|
+
> **Rule catalog ID:** R030
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
GitHub Actions workflow YAML files triggered by `pull_request_target` that use `actions/checkout`.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
This rule reports `actions/checkout` steps in `pull_request_target` workflows when `with.ref` or `with.repository` points at the pull request head branch, SHA, or repository.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
GitHub warns that `pull_request_target` runs with the base repository's privileges and should not be used to build or run untrusted code from the pull request. Checking out the PR head inside this privileged trigger is a common way to accidentally create a "pwn request" workflow.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
on:
|
|
21
|
+
pull_request_target:
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
annotate:
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v5
|
|
28
|
+
with:
|
|
29
|
+
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
30
|
+
ref: ${{ github.event.pull_request.head.ref }}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## ✅ Correct
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
on:
|
|
37
|
+
pull_request_target:
|
|
38
|
+
|
|
39
|
+
jobs:
|
|
40
|
+
annotate:
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/github-script@v8
|
|
44
|
+
with:
|
|
45
|
+
script: |
|
|
46
|
+
await github.rest.issues.createComment({
|
|
47
|
+
owner: context.repo.owner,
|
|
48
|
+
repo: context.repo.repo,
|
|
49
|
+
issue_number: context.issue.number,
|
|
50
|
+
body: "Thanks for the PR!"
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## Additional examples
|
|
56
|
+
|
|
57
|
+
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.
|
|
58
|
+
|
|
59
|
+
## ESLint flat config example
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
import githubActions from "eslint-plugin-github-actions-2";
|
|
63
|
+
|
|
64
|
+
export default [
|
|
65
|
+
{
|
|
66
|
+
files: ["**/*.{yml,yaml}"],
|
|
67
|
+
plugins: {
|
|
68
|
+
"github-actions": githubActions,
|
|
69
|
+
},
|
|
70
|
+
rules: {
|
|
71
|
+
"github-actions/no-pr-head-checkout-in-pull-request-target": "error",
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## When not to use it
|
|
78
|
+
|
|
79
|
+
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.
|
|
80
|
+
## Further reading
|
|
81
|
+
|
|
82
|
+
- [https://docs.github.com/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target](https://docs.github.com/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target)
|
|
83
|
+
- [https://docs.github.com/actions/reference/security/secure-use](https://docs.github.com/actions/reference/security/secure-use)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# no-pre-if-without-pre
|
|
2
|
+
|
|
3
|
+
> **Rule catalog ID:** R045
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
Action metadata `runs.pre-if` declarations.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
Reports `runs.pre-if` when `runs.pre` is missing.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
`pre-if` has no effect unless a `pre` hook exists.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
runs:
|
|
21
|
+
using: node20
|
|
22
|
+
main: dist/index.js
|
|
23
|
+
pre-if: runner.os == 'Linux'
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ✅ Correct
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
runs:
|
|
30
|
+
using: node20
|
|
31
|
+
pre: dist/setup.js
|
|
32
|
+
pre-if: runner.os == 'Linux'
|
|
33
|
+
main: dist/index.js
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## Additional examples
|
|
38
|
+
|
|
39
|
+
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.
|
|
40
|
+
|
|
41
|
+
## ESLint flat config example
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import githubActions from "eslint-plugin-github-actions-2";
|
|
45
|
+
|
|
46
|
+
export default [
|
|
47
|
+
{
|
|
48
|
+
files: ["**/*.{yml,yaml}"],
|
|
49
|
+
plugins: {
|
|
50
|
+
"github-actions": githubActions,
|
|
51
|
+
},
|
|
52
|
+
rules: {
|
|
53
|
+
"github-actions/no-pre-if-without-pre": "error",
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## When not to use it
|
|
60
|
+
|
|
61
|
+
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.
|
|
62
|
+
## Further reading
|
|
63
|
+
|
|
64
|
+
- [https://docs.github.com/actions/reference/workflows-and-actions/metadata-syntax#runs-for-javascript-actions](https://docs.github.com/actions/reference/workflows-and-actions/metadata-syntax#runs-for-javascript-actions)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# no-required-input-with-default
|
|
2
|
+
|
|
3
|
+
> **Rule catalog ID:** R047
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
Action metadata `inputs.<id>` definitions.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
Reports input definitions that set both `required: true` and `default`.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
A default value means callers can omit the input, which conflicts with `required: true`.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
inputs:
|
|
21
|
+
token:
|
|
22
|
+
description: Token
|
|
23
|
+
required: true
|
|
24
|
+
default: abc123
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## ✅ Correct
|
|
28
|
+
|
|
29
|
+
```yaml
|
|
30
|
+
inputs:
|
|
31
|
+
token:
|
|
32
|
+
description: Token
|
|
33
|
+
required: true
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## Additional examples
|
|
38
|
+
|
|
39
|
+
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.
|
|
40
|
+
|
|
41
|
+
## ESLint flat config example
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import githubActions from "eslint-plugin-github-actions-2";
|
|
45
|
+
|
|
46
|
+
export default [
|
|
47
|
+
{
|
|
48
|
+
files: ["**/*.{yml,yaml}"],
|
|
49
|
+
plugins: {
|
|
50
|
+
"github-actions": githubActions,
|
|
51
|
+
},
|
|
52
|
+
rules: {
|
|
53
|
+
"github-actions/no-required-input-with-default": "error",
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## When not to use it
|
|
60
|
+
|
|
61
|
+
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.
|
|
62
|
+
## Further reading
|
|
63
|
+
|
|
64
|
+
- [https://docs.github.com/actions/reference/workflows-and-actions/metadata-syntax#inputs](https://docs.github.com/actions/reference/workflows-and-actions/metadata-syntax#inputs)
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# no-secrets-in-if
|
|
2
|
+
|
|
3
|
+
> **Rule catalog ID:** R027
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
GitHub Actions workflow YAML files with job-level or step-level `if` conditionals.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
This rule reports `if` conditionals that directly reference the `secrets` context, such as `secrets.DEPLOY_TOKEN`.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
GitHub documents that secrets cannot be directly referenced in `if:` conditionals. The safe pattern is to assign the secret to an environment variable first, then check the environment variable inside the conditional.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
jobs:
|
|
21
|
+
deploy:
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- if: ${{ secrets.DEPLOY_TOKEN != '' }}
|
|
25
|
+
run: ./deploy.sh
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## ✅ Correct
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
jobs:
|
|
32
|
+
deploy:
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
env:
|
|
35
|
+
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
|
|
36
|
+
steps:
|
|
37
|
+
- if: ${{ env.DEPLOY_TOKEN != '' }}
|
|
38
|
+
run: ./deploy.sh
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## Additional examples
|
|
43
|
+
|
|
44
|
+
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.
|
|
45
|
+
|
|
46
|
+
## ESLint flat config example
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import githubActions from "eslint-plugin-github-actions-2";
|
|
50
|
+
|
|
51
|
+
export default [
|
|
52
|
+
{
|
|
53
|
+
files: ["**/*.{yml,yaml}"],
|
|
54
|
+
plugins: {
|
|
55
|
+
"github-actions": githubActions,
|
|
56
|
+
},
|
|
57
|
+
rules: {
|
|
58
|
+
"github-actions/no-secrets-in-if": "error",
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## When not to use it
|
|
65
|
+
|
|
66
|
+
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.
|
|
67
|
+
## Further reading
|
|
68
|
+
|
|
69
|
+
- [https://docs.github.com/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idstepsif](https://docs.github.com/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idstepsif)
|
|
70
|
+
- [https://docs.github.com/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idif](https://docs.github.com/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idif)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# no-self-hosted-runner-on-fork-pr-events
|
|
2
|
+
|
|
3
|
+
> **Rule catalog ID:** R036
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
GitHub Actions workflow YAML files triggered by fork-capable pull request events such as `pull_request`, `pull_request_target`, `pull_request_review`, `pull_request_review_comment`, and `issue_comment`.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
This rule reports jobs that select a self-hosted runner while the workflow can be invoked from forked or Dependabot pull request activity.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
GitHub documents that forked pull request activity is sent to the base repository for these PR-related events, and that self-hosted runners do not provide the same clean, ephemeral isolation guarantees as GitHub-hosted runners. Running untrusted contributor-triggered workflows on self-hosted infrastructure can expose secrets, tokens, network access, or persistent runner state.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
on:
|
|
21
|
+
pull_request:
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
test:
|
|
25
|
+
runs-on:
|
|
26
|
+
- self-hosted
|
|
27
|
+
- linux
|
|
28
|
+
steps:
|
|
29
|
+
- run: npm test
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## ✅ Correct
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
on:
|
|
36
|
+
pull_request:
|
|
37
|
+
|
|
38
|
+
jobs:
|
|
39
|
+
test:
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
steps:
|
|
42
|
+
- run: npm test
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## Additional examples
|
|
47
|
+
|
|
48
|
+
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.
|
|
49
|
+
|
|
50
|
+
## ESLint flat config example
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import githubActions from "eslint-plugin-github-actions-2";
|
|
54
|
+
|
|
55
|
+
export default [
|
|
56
|
+
{
|
|
57
|
+
files: ["**/*.{yml,yaml}"],
|
|
58
|
+
plugins: {
|
|
59
|
+
"github-actions": githubActions,
|
|
60
|
+
},
|
|
61
|
+
rules: {
|
|
62
|
+
"github-actions/no-self-hosted-runner-on-fork-pr-events": "error",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## When not to use it
|
|
69
|
+
|
|
70
|
+
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.
|
|
71
|
+
## Further reading
|
|
72
|
+
|
|
73
|
+
- [https://docs.github.com/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request](https://docs.github.com/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request)
|
|
74
|
+
- [https://docs.github.com/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target](https://docs.github.com/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target)
|
|
75
|
+
- [https://docs.github.com/actions/reference/security/secure-use#hardening-for-self-hosted-runners](https://docs.github.com/actions/reference/security/secure-use#hardening-for-self-hosted-runners)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# no-subdirectory-template-file-pattern
|
|
2
|
+
|
|
3
|
+
> **Rule catalog ID:** R062
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
`filePatterns` entries in workflow-template properties metadata.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
Reports patterns containing path separators that target subdirectories.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
Workflow-template `filePatterns` are intended to match repository-root indicators.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{ "filePatterns": ["^src/package.json$"] }
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## ✅ Correct
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{ "filePatterns": ["^package.json$", "^go\\.mod$"] }
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## Additional examples
|
|
31
|
+
|
|
32
|
+
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.
|
|
33
|
+
|
|
34
|
+
## ESLint flat config example
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import githubActions from "eslint-plugin-github-actions-2";
|
|
38
|
+
|
|
39
|
+
export default [
|
|
40
|
+
{
|
|
41
|
+
files: ["**/*.{yml,yaml}"],
|
|
42
|
+
plugins: {
|
|
43
|
+
"github-actions": githubActions,
|
|
44
|
+
},
|
|
45
|
+
rules: {
|
|
46
|
+
"github-actions/no-subdirectory-template-file-pattern": "error",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## When not to use it
|
|
53
|
+
|
|
54
|
+
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.
|
|
55
|
+
## Further reading
|
|
56
|
+
|
|
57
|
+
- [https://docs.github.com/actions/reference/workflows-and-actions/reusing-workflow-configurations#metadata-file-requirements](https://docs.github.com/actions/reference/workflows-and-actions/reusing-workflow-configurations#metadata-file-requirements)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# no-template-placeholder-in-non-template-workflow
|
|
2
|
+
|
|
3
|
+
> **Rule catalog ID:** R069
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
Regular workflow YAML files outside `workflow-templates/`.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
Reports usage of `$default-branch` placeholder tokens.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
`$default-branch` is a template-only token and should not appear in normal workflow files.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
on:
|
|
21
|
+
push:
|
|
22
|
+
branches:
|
|
23
|
+
- $default-branch
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ✅ Correct
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
on:
|
|
30
|
+
push:
|
|
31
|
+
branches:
|
|
32
|
+
- main
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## Additional examples
|
|
37
|
+
|
|
38
|
+
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.
|
|
39
|
+
|
|
40
|
+
## ESLint flat config example
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import githubActions from "eslint-plugin-github-actions-2";
|
|
44
|
+
|
|
45
|
+
export default [
|
|
46
|
+
{
|
|
47
|
+
files: ["**/*.{yml,yaml}"],
|
|
48
|
+
plugins: {
|
|
49
|
+
"github-actions": githubActions,
|
|
50
|
+
},
|
|
51
|
+
rules: {
|
|
52
|
+
"github-actions/no-template-placeholder-in-non-template-workflow": "error",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## When not to use it
|
|
59
|
+
|
|
60
|
+
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.
|
|
61
|
+
## Further reading
|
|
62
|
+
|
|
63
|
+
- [https://docs.github.com/actions/reference/workflows-and-actions/reusing-workflow-configurations](https://docs.github.com/actions/reference/workflows-and-actions/reusing-workflow-configurations)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# no-top-level-env
|
|
2
|
+
|
|
3
|
+
> **Rule catalog ID:** R013
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
GitHub Actions workflow YAML files that declare `env` at the top level.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
This rule reports workflows that define a top-level `env` block.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
Top-level environment variables affect every job and can hide which parts of a workflow actually depend on a variable. Narrower scoping keeps workflow behavior easier to audit.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
env:
|
|
21
|
+
NODE_ENV: production
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## ✅ Correct
|
|
25
|
+
|
|
26
|
+
```yaml
|
|
27
|
+
jobs:
|
|
28
|
+
build:
|
|
29
|
+
name: Build
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
env:
|
|
32
|
+
NODE_ENV: production
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## Additional examples
|
|
37
|
+
|
|
38
|
+
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.
|
|
39
|
+
|
|
40
|
+
## ESLint flat config example
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import githubActions from "eslint-plugin-github-actions-2";
|
|
44
|
+
|
|
45
|
+
export default [
|
|
46
|
+
{
|
|
47
|
+
files: ["**/*.{yml,yaml}"],
|
|
48
|
+
plugins: {
|
|
49
|
+
"github-actions": githubActions,
|
|
50
|
+
},
|
|
51
|
+
rules: {
|
|
52
|
+
"github-actions/no-top-level-env": "error",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## When not to use it
|
|
59
|
+
|
|
60
|
+
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.
|
|
61
|
+
## Further reading
|
|
62
|
+
|
|
63
|
+
- [https://docs.github.com/actions/reference/workflows-and-actions/workflow-syntax#env](https://docs.github.com/actions/reference/workflows-and-actions/workflow-syntax#env)
|
|
64
|
+
- [https://docs.github.com/actions/learn-github-actions/variables](https://docs.github.com/actions/learn-github-actions/variables)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# no-top-level-permissions
|
|
2
|
+
|
|
3
|
+
> **Rule catalog ID:** R014
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
GitHub Actions workflow YAML files that declare `permissions` at the top level.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
This rule reports workflows that define top-level `permissions` instead of scoping token permissions per job.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
Some teams want every job to declare the exact token scope it needs so that permission review happens at the job boundary rather than once per workflow.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
permissions:
|
|
21
|
+
contents: read
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## ✅ Correct
|
|
25
|
+
|
|
26
|
+
```yaml
|
|
27
|
+
jobs:
|
|
28
|
+
build:
|
|
29
|
+
name: Build
|
|
30
|
+
permissions:
|
|
31
|
+
contents: read
|
|
32
|
+
runs-on: ubuntu-latest
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## Additional examples
|
|
37
|
+
|
|
38
|
+
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.
|
|
39
|
+
|
|
40
|
+
## ESLint flat config example
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import githubActions from "eslint-plugin-github-actions-2";
|
|
44
|
+
|
|
45
|
+
export default [
|
|
46
|
+
{
|
|
47
|
+
files: ["**/*.{yml,yaml}"],
|
|
48
|
+
plugins: {
|
|
49
|
+
"github-actions": githubActions,
|
|
50
|
+
},
|
|
51
|
+
rules: {
|
|
52
|
+
"github-actions/no-top-level-permissions": "error",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## When not to use it
|
|
59
|
+
|
|
60
|
+
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.
|
|
61
|
+
## Further reading
|
|
62
|
+
|
|
63
|
+
- [https://docs.github.com/actions/reference/workflows-and-actions/workflow-syntax#permissions](https://docs.github.com/actions/reference/workflows-and-actions/workflow-syntax#permissions)
|
|
64
|
+
- [https://docs.github.com/actions/security-for-github-actions/security-guides/automatic-token-authentication](https://docs.github.com/actions/security-for-github-actions/security-guides/automatic-token-authentication)
|