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.
Files changed (410) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +164 -0
  4. package/dist/_internal/case-police-dictionary.d.ts +10 -0
  5. package/dist/_internal/case-police-dictionary.d.ts.map +1 -0
  6. package/dist/_internal/case-police-dictionary.js +486 -0
  7. package/dist/_internal/case-police-dictionary.js.map +1 -0
  8. package/dist/_internal/casing.d.ts +17 -0
  9. package/dist/_internal/casing.d.ts.map +1 -0
  10. package/dist/_internal/casing.js +197 -0
  11. package/dist/_internal/casing.js.map +1 -0
  12. package/dist/_internal/github-actions-config-references.d.ts +16 -0
  13. package/dist/_internal/github-actions-config-references.d.ts.map +1 -0
  14. package/dist/_internal/github-actions-config-references.js +76 -0
  15. package/dist/_internal/github-actions-config-references.js.map +1 -0
  16. package/dist/_internal/github-actions-trigger-events.d.ts +13 -0
  17. package/dist/_internal/github-actions-trigger-events.d.ts.map +1 -0
  18. package/dist/_internal/github-actions-trigger-events.js +47 -0
  19. package/dist/_internal/github-actions-trigger-events.js.map +1 -0
  20. package/dist/_internal/github-expressions.d.ts +9 -0
  21. package/dist/_internal/github-expressions.d.ts.map +1 -0
  22. package/dist/_internal/github-expressions.js +87 -0
  23. package/dist/_internal/github-expressions.js.map +1 -0
  24. package/dist/_internal/lint-targets.d.ts +21 -0
  25. package/dist/_internal/lint-targets.d.ts.map +1 -0
  26. package/dist/_internal/lint-targets.js +60 -0
  27. package/dist/_internal/lint-targets.js.map +1 -0
  28. package/dist/_internal/rule-docs.d.ts +16 -0
  29. package/dist/_internal/rule-docs.d.ts.map +1 -0
  30. package/dist/_internal/rule-docs.js +2 -0
  31. package/dist/_internal/rule-docs.js.map +1 -0
  32. package/dist/_internal/rules-registry.d.ts +145 -0
  33. package/dist/_internal/rules-registry.d.ts.map +1 -0
  34. package/dist/_internal/rules-registry.js +144 -0
  35. package/dist/_internal/rules-registry.js.map +1 -0
  36. package/dist/_internal/workflow-template-properties.d.ts +20 -0
  37. package/dist/_internal/workflow-template-properties.d.ts.map +1 -0
  38. package/dist/_internal/workflow-template-properties.js +44 -0
  39. package/dist/_internal/workflow-template-properties.js.map +1 -0
  40. package/dist/_internal/workflow-yaml.d.ts +47 -0
  41. package/dist/_internal/workflow-yaml.d.ts.map +1 -0
  42. package/dist/_internal/workflow-yaml.js +140 -0
  43. package/dist/_internal/workflow-yaml.js.map +1 -0
  44. package/dist/_internal/yaml-traversal.d.ts +10 -0
  45. package/dist/_internal/yaml-traversal.d.ts.map +1 -0
  46. package/dist/_internal/yaml-traversal.js +38 -0
  47. package/dist/_internal/yaml-traversal.js.map +1 -0
  48. package/dist/plugin.cjs +7107 -0
  49. package/dist/plugin.cjs.map +7 -0
  50. package/dist/plugin.d.cts +34 -0
  51. package/dist/plugin.d.ts +34 -0
  52. package/dist/plugin.d.ts.map +1 -0
  53. package/dist/plugin.js +122 -0
  54. package/dist/plugin.js.map +1 -0
  55. package/dist/rules/action-name-casing.d.ts +9 -0
  56. package/dist/rules/action-name-casing.d.ts.map +1 -0
  57. package/dist/rules/action-name-casing.js +141 -0
  58. package/dist/rules/action-name-casing.js.map +1 -0
  59. package/dist/rules/job-id-casing.d.ts +9 -0
  60. package/dist/rules/job-id-casing.d.ts.map +1 -0
  61. package/dist/rules/job-id-casing.js +123 -0
  62. package/dist/rules/job-id-casing.js.map +1 -0
  63. package/dist/rules/max-jobs-per-action.d.ts +9 -0
  64. package/dist/rules/max-jobs-per-action.d.ts.map +1 -0
  65. package/dist/rules/max-jobs-per-action.js +61 -0
  66. package/dist/rules/max-jobs-per-action.js.map +1 -0
  67. package/dist/rules/no-case-insensitive-input-id-collision.d.ts +9 -0
  68. package/dist/rules/no-case-insensitive-input-id-collision.d.ts.map +1 -0
  69. package/dist/rules/no-case-insensitive-input-id-collision.js +66 -0
  70. package/dist/rules/no-case-insensitive-input-id-collision.js.map +1 -0
  71. package/dist/rules/no-composite-input-env-access.d.ts +9 -0
  72. package/dist/rules/no-composite-input-env-access.d.ts.map +1 -0
  73. package/dist/rules/no-composite-input-env-access.js +62 -0
  74. package/dist/rules/no-composite-input-env-access.js.map +1 -0
  75. package/dist/rules/no-deprecated-node-runtime.d.ts +9 -0
  76. package/dist/rules/no-deprecated-node-runtime.d.ts.map +1 -0
  77. package/dist/rules/no-deprecated-node-runtime.js +59 -0
  78. package/dist/rules/no-deprecated-node-runtime.js.map +1 -0
  79. package/dist/rules/no-duplicate-composite-step-id.d.ts +9 -0
  80. package/dist/rules/no-duplicate-composite-step-id.d.ts.map +1 -0
  81. package/dist/rules/no-duplicate-composite-step-id.js +74 -0
  82. package/dist/rules/no-duplicate-composite-step-id.js.map +1 -0
  83. package/dist/rules/no-empty-template-file-pattern.d.ts +9 -0
  84. package/dist/rules/no-empty-template-file-pattern.d.ts.map +1 -0
  85. package/dist/rules/no-empty-template-file-pattern.js +49 -0
  86. package/dist/rules/no-empty-template-file-pattern.js.map +1 -0
  87. package/dist/rules/no-external-job.d.ts +9 -0
  88. package/dist/rules/no-external-job.d.ts.map +1 -0
  89. package/dist/rules/no-external-job.js +49 -0
  90. package/dist/rules/no-external-job.js.map +1 -0
  91. package/dist/rules/no-hardcoded-default-branch-in-template.d.ts +9 -0
  92. package/dist/rules/no-hardcoded-default-branch-in-template.d.ts.map +1 -0
  93. package/dist/rules/no-hardcoded-default-branch-in-template.js +54 -0
  94. package/dist/rules/no-hardcoded-default-branch-in-template.js.map +1 -0
  95. package/dist/rules/no-icon-file-extension-in-template-icon-name.d.ts +9 -0
  96. package/dist/rules/no-icon-file-extension-in-template-icon-name.d.ts.map +1 -0
  97. package/dist/rules/no-icon-file-extension-in-template-icon-name.js +54 -0
  98. package/dist/rules/no-icon-file-extension-in-template-icon-name.js.map +1 -0
  99. package/dist/rules/no-inherit-secrets.d.ts +9 -0
  100. package/dist/rules/no-inherit-secrets.d.ts.map +1 -0
  101. package/dist/rules/no-inherit-secrets.js +57 -0
  102. package/dist/rules/no-inherit-secrets.js.map +1 -0
  103. package/dist/rules/no-invalid-concurrency-context.d.ts +9 -0
  104. package/dist/rules/no-invalid-concurrency-context.d.ts.map +1 -0
  105. package/dist/rules/no-invalid-concurrency-context.js +141 -0
  106. package/dist/rules/no-invalid-concurrency-context.js.map +1 -0
  107. package/dist/rules/no-invalid-key.d.ts +9 -0
  108. package/dist/rules/no-invalid-key.d.ts.map +1 -0
  109. package/dist/rules/no-invalid-key.js +152 -0
  110. package/dist/rules/no-invalid-key.js.map +1 -0
  111. package/dist/rules/no-invalid-reusable-workflow-job-key.d.ts +9 -0
  112. package/dist/rules/no-invalid-reusable-workflow-job-key.d.ts.map +1 -0
  113. package/dist/rules/no-invalid-reusable-workflow-job-key.js +73 -0
  114. package/dist/rules/no-invalid-reusable-workflow-job-key.js.map +1 -0
  115. package/dist/rules/no-invalid-template-file-pattern-regex.d.ts +9 -0
  116. package/dist/rules/no-invalid-template-file-pattern-regex.d.ts.map +1 -0
  117. package/dist/rules/no-invalid-template-file-pattern-regex.js +58 -0
  118. package/dist/rules/no-invalid-template-file-pattern-regex.js.map +1 -0
  119. package/dist/rules/no-invalid-workflow-call-output-value.d.ts +9 -0
  120. package/dist/rules/no-invalid-workflow-call-output-value.d.ts.map +1 -0
  121. package/dist/rules/no-invalid-workflow-call-output-value.js +99 -0
  122. package/dist/rules/no-invalid-workflow-call-output-value.js.map +1 -0
  123. package/dist/rules/no-path-separators-in-template-icon-name.d.ts +9 -0
  124. package/dist/rules/no-path-separators-in-template-icon-name.d.ts.map +1 -0
  125. package/dist/rules/no-path-separators-in-template-icon-name.js +52 -0
  126. package/dist/rules/no-path-separators-in-template-icon-name.js.map +1 -0
  127. package/dist/rules/no-post-if-without-post.d.ts +9 -0
  128. package/dist/rules/no-post-if-without-post.d.ts.map +1 -0
  129. package/dist/rules/no-post-if-without-post.js +52 -0
  130. package/dist/rules/no-post-if-without-post.js.map +1 -0
  131. package/dist/rules/no-pr-head-checkout-in-pull-request-target.d.ts +12 -0
  132. package/dist/rules/no-pr-head-checkout-in-pull-request-target.d.ts.map +1 -0
  133. package/dist/rules/no-pr-head-checkout-in-pull-request-target.js +89 -0
  134. package/dist/rules/no-pr-head-checkout-in-pull-request-target.js.map +1 -0
  135. package/dist/rules/no-pre-if-without-pre.d.ts +9 -0
  136. package/dist/rules/no-pre-if-without-pre.d.ts.map +1 -0
  137. package/dist/rules/no-pre-if-without-pre.js +51 -0
  138. package/dist/rules/no-pre-if-without-pre.js.map +1 -0
  139. package/dist/rules/no-required-input-with-default.d.ts +9 -0
  140. package/dist/rules/no-required-input-with-default.d.ts.map +1 -0
  141. package/dist/rules/no-required-input-with-default.js +68 -0
  142. package/dist/rules/no-required-input-with-default.js.map +1 -0
  143. package/dist/rules/no-secrets-in-if.d.ts +9 -0
  144. package/dist/rules/no-secrets-in-if.d.ts.map +1 -0
  145. package/dist/rules/no-secrets-in-if.js +84 -0
  146. package/dist/rules/no-secrets-in-if.js.map +1 -0
  147. package/dist/rules/no-self-hosted-runner-on-fork-pr-events.d.ts +9 -0
  148. package/dist/rules/no-self-hosted-runner-on-fork-pr-events.d.ts.map +1 -0
  149. package/dist/rules/no-self-hosted-runner-on-fork-pr-events.js +93 -0
  150. package/dist/rules/no-self-hosted-runner-on-fork-pr-events.js.map +1 -0
  151. package/dist/rules/no-subdirectory-template-file-pattern.d.ts +9 -0
  152. package/dist/rules/no-subdirectory-template-file-pattern.d.ts.map +1 -0
  153. package/dist/rules/no-subdirectory-template-file-pattern.js +52 -0
  154. package/dist/rules/no-subdirectory-template-file-pattern.js.map +1 -0
  155. package/dist/rules/no-template-placeholder-in-non-template-workflow.d.ts +9 -0
  156. package/dist/rules/no-template-placeholder-in-non-template-workflow.d.ts.map +1 -0
  157. package/dist/rules/no-template-placeholder-in-non-template-workflow.js +55 -0
  158. package/dist/rules/no-template-placeholder-in-non-template-workflow.js.map +1 -0
  159. package/dist/rules/no-top-level-env.d.ts +9 -0
  160. package/dist/rules/no-top-level-env.d.ts.map +1 -0
  161. package/dist/rules/no-top-level-env.js +42 -0
  162. package/dist/rules/no-top-level-env.js.map +1 -0
  163. package/dist/rules/no-top-level-permissions.d.ts +9 -0
  164. package/dist/rules/no-top-level-permissions.d.ts.map +1 -0
  165. package/dist/rules/no-top-level-permissions.js +39 -0
  166. package/dist/rules/no-top-level-permissions.js.map +1 -0
  167. package/dist/rules/no-universal-template-file-pattern.d.ts +9 -0
  168. package/dist/rules/no-universal-template-file-pattern.d.ts.map +1 -0
  169. package/dist/rules/no-universal-template-file-pattern.js +60 -0
  170. package/dist/rules/no-universal-template-file-pattern.js.map +1 -0
  171. package/dist/rules/no-unknown-input-reference-in-composite.d.ts +9 -0
  172. package/dist/rules/no-unknown-input-reference-in-composite.d.ts.map +1 -0
  173. package/dist/rules/no-unknown-input-reference-in-composite.js +80 -0
  174. package/dist/rules/no-unknown-input-reference-in-composite.js.map +1 -0
  175. package/dist/rules/no-unknown-job-output-reference.d.ts +9 -0
  176. package/dist/rules/no-unknown-job-output-reference.d.ts.map +1 -0
  177. package/dist/rules/no-unknown-job-output-reference.js +229 -0
  178. package/dist/rules/no-unknown-job-output-reference.js.map +1 -0
  179. package/dist/rules/no-unknown-step-reference.d.ts +9 -0
  180. package/dist/rules/no-unknown-step-reference.d.ts.map +1 -0
  181. package/dist/rules/no-unknown-step-reference.js +133 -0
  182. package/dist/rules/no-unknown-step-reference.js.map +1 -0
  183. package/dist/rules/no-untrusted-input-in-run.d.ts +9 -0
  184. package/dist/rules/no-untrusted-input-in-run.d.ts.map +1 -0
  185. package/dist/rules/no-untrusted-input-in-run.js +115 -0
  186. package/dist/rules/no-untrusted-input-in-run.js.map +1 -0
  187. package/dist/rules/no-unused-input-in-composite.d.ts +9 -0
  188. package/dist/rules/no-unused-input-in-composite.d.ts.map +1 -0
  189. package/dist/rules/no-unused-input-in-composite.js +78 -0
  190. package/dist/rules/no-unused-input-in-composite.js.map +1 -0
  191. package/dist/rules/no-write-all-permissions.d.ts +9 -0
  192. package/dist/rules/no-write-all-permissions.d.ts.map +1 -0
  193. package/dist/rules/no-write-all-permissions.js +61 -0
  194. package/dist/rules/no-write-all-permissions.js.map +1 -0
  195. package/dist/rules/pin-action-shas.d.ts +12 -0
  196. package/dist/rules/pin-action-shas.d.ts.map +1 -0
  197. package/dist/rules/pin-action-shas.js +100 -0
  198. package/dist/rules/pin-action-shas.js.map +1 -0
  199. package/dist/rules/prefer-action-yml.d.ts +9 -0
  200. package/dist/rules/prefer-action-yml.d.ts.map +1 -0
  201. package/dist/rules/prefer-action-yml.js +37 -0
  202. package/dist/rules/prefer-action-yml.js.map +1 -0
  203. package/dist/rules/prefer-fail-fast.d.ts +9 -0
  204. package/dist/rules/prefer-fail-fast.d.ts.map +1 -0
  205. package/dist/rules/prefer-fail-fast.js +61 -0
  206. package/dist/rules/prefer-fail-fast.js.map +1 -0
  207. package/dist/rules/prefer-file-extension.d.ts +9 -0
  208. package/dist/rules/prefer-file-extension.d.ts.map +1 -0
  209. package/dist/rules/prefer-file-extension.js +104 -0
  210. package/dist/rules/prefer-file-extension.js.map +1 -0
  211. package/dist/rules/prefer-inputs-context.d.ts +9 -0
  212. package/dist/rules/prefer-inputs-context.d.ts.map +1 -0
  213. package/dist/rules/prefer-inputs-context.js +91 -0
  214. package/dist/rules/prefer-inputs-context.js.map +1 -0
  215. package/dist/rules/prefer-step-uses-style.d.ts +9 -0
  216. package/dist/rules/prefer-step-uses-style.d.ts.map +1 -0
  217. package/dist/rules/prefer-step-uses-style.js +209 -0
  218. package/dist/rules/prefer-step-uses-style.js.map +1 -0
  219. package/dist/rules/prefer-template-yml-extension.d.ts +9 -0
  220. package/dist/rules/prefer-template-yml-extension.d.ts.map +1 -0
  221. package/dist/rules/prefer-template-yml-extension.js +41 -0
  222. package/dist/rules/prefer-template-yml-extension.js.map +1 -0
  223. package/dist/rules/require-action-name.d.ts +9 -0
  224. package/dist/rules/require-action-name.d.ts.map +1 -0
  225. package/dist/rules/require-action-name.js +57 -0
  226. package/dist/rules/require-action-name.js.map +1 -0
  227. package/dist/rules/require-action-run-name.d.ts +9 -0
  228. package/dist/rules/require-action-run-name.d.ts.map +1 -0
  229. package/dist/rules/require-action-run-name.js +56 -0
  230. package/dist/rules/require-action-run-name.js.map +1 -0
  231. package/dist/rules/require-checkout-before-local-action.d.ts +9 -0
  232. package/dist/rules/require-checkout-before-local-action.d.ts.map +1 -0
  233. package/dist/rules/require-checkout-before-local-action.js +74 -0
  234. package/dist/rules/require-checkout-before-local-action.js.map +1 -0
  235. package/dist/rules/require-composite-step-name.d.ts +9 -0
  236. package/dist/rules/require-composite-step-name.d.ts.map +1 -0
  237. package/dist/rules/require-composite-step-name.js +67 -0
  238. package/dist/rules/require-composite-step-name.js.map +1 -0
  239. package/dist/rules/require-job-name.d.ts +9 -0
  240. package/dist/rules/require-job-name.d.ts.map +1 -0
  241. package/dist/rules/require-job-name.js +70 -0
  242. package/dist/rules/require-job-name.js.map +1 -0
  243. package/dist/rules/require-job-step-name.d.ts +9 -0
  244. package/dist/rules/require-job-step-name.d.ts.map +1 -0
  245. package/dist/rules/require-job-step-name.js +71 -0
  246. package/dist/rules/require-job-step-name.js.map +1 -0
  247. package/dist/rules/require-job-timeout-minutes.d.ts +9 -0
  248. package/dist/rules/require-job-timeout-minutes.d.ts.map +1 -0
  249. package/dist/rules/require-job-timeout-minutes.js +99 -0
  250. package/dist/rules/require-job-timeout-minutes.js.map +1 -0
  251. package/dist/rules/require-merge-group-trigger.d.ts +9 -0
  252. package/dist/rules/require-merge-group-trigger.d.ts.map +1 -0
  253. package/dist/rules/require-merge-group-trigger.js +65 -0
  254. package/dist/rules/require-merge-group-trigger.js.map +1 -0
  255. package/dist/rules/require-pull-request-target-branches.d.ts +9 -0
  256. package/dist/rules/require-pull-request-target-branches.d.ts.map +1 -0
  257. package/dist/rules/require-pull-request-target-branches.js +102 -0
  258. package/dist/rules/require-pull-request-target-branches.js.map +1 -0
  259. package/dist/rules/require-run-step-shell.d.ts +9 -0
  260. package/dist/rules/require-run-step-shell.d.ts.map +1 -0
  261. package/dist/rules/require-run-step-shell.js +114 -0
  262. package/dist/rules/require-run-step-shell.js.map +1 -0
  263. package/dist/rules/require-template-categories.d.ts +9 -0
  264. package/dist/rules/require-template-categories.d.ts.map +1 -0
  265. package/dist/rules/require-template-categories.js +55 -0
  266. package/dist/rules/require-template-categories.js.map +1 -0
  267. package/dist/rules/require-template-file-patterns.d.ts +9 -0
  268. package/dist/rules/require-template-file-patterns.d.ts.map +1 -0
  269. package/dist/rules/require-template-file-patterns.js +55 -0
  270. package/dist/rules/require-template-file-patterns.js.map +1 -0
  271. package/dist/rules/require-template-icon-file-exists.d.ts +9 -0
  272. package/dist/rules/require-template-icon-file-exists.d.ts.map +1 -0
  273. package/dist/rules/require-template-icon-file-exists.js +61 -0
  274. package/dist/rules/require-template-icon-file-exists.js.map +1 -0
  275. package/dist/rules/require-template-icon-name.d.ts +9 -0
  276. package/dist/rules/require-template-icon-name.d.ts.map +1 -0
  277. package/dist/rules/require-template-icon-name.js +48 -0
  278. package/dist/rules/require-template-icon-name.js.map +1 -0
  279. package/dist/rules/require-template-workflow-name.d.ts +9 -0
  280. package/dist/rules/require-template-workflow-name.d.ts.map +1 -0
  281. package/dist/rules/require-template-workflow-name.js +48 -0
  282. package/dist/rules/require-template-workflow-name.js.map +1 -0
  283. package/dist/rules/require-trigger-types.d.ts +9 -0
  284. package/dist/rules/require-trigger-types.d.ts.map +1 -0
  285. package/dist/rules/require-trigger-types.js +126 -0
  286. package/dist/rules/require-trigger-types.js.map +1 -0
  287. package/dist/rules/require-workflow-call-input-type.d.ts +9 -0
  288. package/dist/rules/require-workflow-call-input-type.d.ts.map +1 -0
  289. package/dist/rules/require-workflow-call-input-type.js +89 -0
  290. package/dist/rules/require-workflow-call-input-type.js.map +1 -0
  291. package/dist/rules/require-workflow-call-output-value.d.ts +9 -0
  292. package/dist/rules/require-workflow-call-output-value.d.ts.map +1 -0
  293. package/dist/rules/require-workflow-call-output-value.js +79 -0
  294. package/dist/rules/require-workflow-call-output-value.js.map +1 -0
  295. package/dist/rules/require-workflow-concurrency.d.ts +9 -0
  296. package/dist/rules/require-workflow-concurrency.d.ts.map +1 -0
  297. package/dist/rules/require-workflow-concurrency.js +157 -0
  298. package/dist/rules/require-workflow-concurrency.js.map +1 -0
  299. package/dist/rules/require-workflow-dispatch-input-type.d.ts +9 -0
  300. package/dist/rules/require-workflow-dispatch-input-type.d.ts.map +1 -0
  301. package/dist/rules/require-workflow-dispatch-input-type.js +80 -0
  302. package/dist/rules/require-workflow-dispatch-input-type.js.map +1 -0
  303. package/dist/rules/require-workflow-interface-description.d.ts +9 -0
  304. package/dist/rules/require-workflow-interface-description.d.ts.map +1 -0
  305. package/dist/rules/require-workflow-interface-description.js +98 -0
  306. package/dist/rules/require-workflow-interface-description.js.map +1 -0
  307. package/dist/rules/require-workflow-permissions.d.ts +9 -0
  308. package/dist/rules/require-workflow-permissions.d.ts.map +1 -0
  309. package/dist/rules/require-workflow-permissions.js +83 -0
  310. package/dist/rules/require-workflow-permissions.js.map +1 -0
  311. package/dist/rules/require-workflow-run-branches.d.ts +9 -0
  312. package/dist/rules/require-workflow-run-branches.d.ts.map +1 -0
  313. package/dist/rules/require-workflow-run-branches.js +84 -0
  314. package/dist/rules/require-workflow-run-branches.js.map +1 -0
  315. package/dist/rules/require-workflow-template-pair.d.ts +9 -0
  316. package/dist/rules/require-workflow-template-pair.d.ts.map +1 -0
  317. package/dist/rules/require-workflow-template-pair.js +47 -0
  318. package/dist/rules/require-workflow-template-pair.js.map +1 -0
  319. package/dist/rules/require-workflow-template-properties-pair.d.ts +9 -0
  320. package/dist/rules/require-workflow-template-properties-pair.d.ts.map +1 -0
  321. package/dist/rules/require-workflow-template-properties-pair.js +49 -0
  322. package/dist/rules/require-workflow-template-properties-pair.js.map +1 -0
  323. package/dist/rules/valid-timeout-minutes.d.ts +9 -0
  324. package/dist/rules/valid-timeout-minutes.d.ts.map +1 -0
  325. package/dist/rules/valid-timeout-minutes.js +255 -0
  326. package/dist/rules/valid-timeout-minutes.js.map +1 -0
  327. package/dist/rules/valid-trigger-events.d.ts +9 -0
  328. package/dist/rules/valid-trigger-events.d.ts.map +1 -0
  329. package/dist/rules/valid-trigger-events.js +100 -0
  330. package/dist/rules/valid-trigger-events.js.map +1 -0
  331. package/docs/rules/action-name-casing.md +64 -0
  332. package/docs/rules/getting-started.md +46 -0
  333. package/docs/rules/job-id-casing.md +73 -0
  334. package/docs/rules/max-jobs-per-action.md +79 -0
  335. package/docs/rules/no-case-insensitive-input-id-collision.md +63 -0
  336. package/docs/rules/no-composite-input-env-access.md +66 -0
  337. package/docs/rules/no-deprecated-node-runtime.md +61 -0
  338. package/docs/rules/no-duplicate-composite-step-id.md +73 -0
  339. package/docs/rules/no-empty-template-file-pattern.md +57 -0
  340. package/docs/rules/no-external-job.md +66 -0
  341. package/docs/rules/no-hardcoded-default-branch-in-template.md +63 -0
  342. package/docs/rules/no-icon-file-extension-in-template-icon-name.md +57 -0
  343. package/docs/rules/no-inherit-secrets.md +65 -0
  344. package/docs/rules/no-invalid-concurrency-context.md +101 -0
  345. package/docs/rules/no-invalid-key.md +86 -0
  346. package/docs/rules/no-invalid-reusable-workflow-job-key.md +74 -0
  347. package/docs/rules/no-invalid-template-file-pattern-regex.md +57 -0
  348. package/docs/rules/no-invalid-workflow-call-output-value.md +80 -0
  349. package/docs/rules/no-path-separators-in-template-icon-name.md +57 -0
  350. package/docs/rules/no-post-if-without-post.md +64 -0
  351. package/docs/rules/no-pr-head-checkout-in-pull-request-target.md +83 -0
  352. package/docs/rules/no-pre-if-without-pre.md +64 -0
  353. package/docs/rules/no-required-input-with-default.md +64 -0
  354. package/docs/rules/no-secrets-in-if.md +70 -0
  355. package/docs/rules/no-self-hosted-runner-on-fork-pr-events.md +75 -0
  356. package/docs/rules/no-subdirectory-template-file-pattern.md +57 -0
  357. package/docs/rules/no-template-placeholder-in-non-template-workflow.md +63 -0
  358. package/docs/rules/no-top-level-env.md +64 -0
  359. package/docs/rules/no-top-level-permissions.md +64 -0
  360. package/docs/rules/no-universal-template-file-pattern.md +57 -0
  361. package/docs/rules/no-unknown-input-reference-in-composite.md +71 -0
  362. package/docs/rules/no-unknown-job-output-reference.md +88 -0
  363. package/docs/rules/no-unknown-step-reference.md +73 -0
  364. package/docs/rules/no-untrusted-input-in-run.md +74 -0
  365. package/docs/rules/no-unused-input-in-composite.md +71 -0
  366. package/docs/rules/no-write-all-permissions.md +60 -0
  367. package/docs/rules/overview.md +91 -0
  368. package/docs/rules/pin-action-shas.md +65 -0
  369. package/docs/rules/prefer-action-yml.md +57 -0
  370. package/docs/rules/prefer-fail-fast.md +72 -0
  371. package/docs/rules/prefer-file-extension.md +77 -0
  372. package/docs/rules/prefer-inputs-context.md +84 -0
  373. package/docs/rules/prefer-step-uses-style.md +70 -0
  374. package/docs/rules/prefer-template-yml-extension.md +57 -0
  375. package/docs/rules/presets/action-metadata.md +18 -0
  376. package/docs/rules/presets/all.md +76 -0
  377. package/docs/rules/presets/index.md +100 -0
  378. package/docs/rules/presets/recommended.md +26 -0
  379. package/docs/rules/presets/security.md +16 -0
  380. package/docs/rules/presets/strict.md +48 -0
  381. package/docs/rules/presets/workflow-template-properties.md +18 -0
  382. package/docs/rules/presets/workflow-templates.md +22 -0
  383. package/docs/rules/require-action-name.md +61 -0
  384. package/docs/rules/require-action-run-name.md +63 -0
  385. package/docs/rules/require-checkout-before-local-action.md +66 -0
  386. package/docs/rules/require-composite-step-name.md +66 -0
  387. package/docs/rules/require-job-name.md +63 -0
  388. package/docs/rules/require-job-step-name.md +69 -0
  389. package/docs/rules/require-job-timeout-minutes.md +76 -0
  390. package/docs/rules/require-merge-group-trigger.md +67 -0
  391. package/docs/rules/require-pull-request-target-branches.md +79 -0
  392. package/docs/rules/require-run-step-shell.md +85 -0
  393. package/docs/rules/require-template-categories.md +62 -0
  394. package/docs/rules/require-template-file-patterns.md +63 -0
  395. package/docs/rules/require-template-icon-file-exists.md +61 -0
  396. package/docs/rules/require-template-icon-name.md +57 -0
  397. package/docs/rules/require-template-workflow-name.md +60 -0
  398. package/docs/rules/require-trigger-types.md +76 -0
  399. package/docs/rules/require-workflow-call-input-type.md +70 -0
  400. package/docs/rules/require-workflow-call-output-value.md +67 -0
  401. package/docs/rules/require-workflow-concurrency.md +73 -0
  402. package/docs/rules/require-workflow-dispatch-input-type.md +70 -0
  403. package/docs/rules/require-workflow-interface-description.md +96 -0
  404. package/docs/rules/require-workflow-permissions.md +75 -0
  405. package/docs/rules/require-workflow-run-branches.md +66 -0
  406. package/docs/rules/require-workflow-template-pair.md +58 -0
  407. package/docs/rules/require-workflow-template-properties-pair.md +58 -0
  408. package/docs/rules/valid-timeout-minutes.md +74 -0
  409. package/docs/rules/valid-trigger-events.md +62 -0
  410. package/package.json +497 -0
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Public plugin entrypoint for eslint-plugin-github-actions-2.
4
+ */
5
+ import type { ESLint, Linter } from "eslint";
6
+ import { type GithubActionsConfigName } from "./_internal/github-actions-config-references.js";
7
+ import { githubActionsRules } from "./_internal/rules-registry.js";
8
+ /** Runtime type for the plugin's generated config presets. */
9
+ export type GithubActionsConfigs = Record<GithubActionsConfigName, GithubActionsPresetConfig>;
10
+ /** Flat config shape produced by this plugin. */
11
+ export type GithubActionsPresetConfig = Linter.Config & {
12
+ rules: NonNullable<Linter.Config["rules"]>;
13
+ };
14
+ /** Fully-qualified ESLint rule ids exposed by this plugin. */
15
+ export type GithubActionsRuleId = `github-actions/${GithubActionsRuleName}`;
16
+ /** Unqualified rule names supported by eslint-plugin-github-actions-2. */
17
+ export type GithubActionsRuleName = keyof typeof githubActionsRules;
18
+ /** Fully assembled plugin contract used by the runtime default export. */
19
+ type GithubActionsPluginContract = Omit<ESLint.Plugin, "configs" | "meta" | "rules"> & {
20
+ configs: GithubActionsConfigs;
21
+ meta: {
22
+ name: string;
23
+ namespace: string;
24
+ version: string;
25
+ };
26
+ rules: NonNullable<ESLint.Plugin["rules"]>;
27
+ };
28
+ /** Main plugin object exported for ESLint consumption. */
29
+ declare const githubActionsPlugin: GithubActionsPluginContract;
30
+ /** Runtime type for the plugin object exported as default. */
31
+ export type GithubActionsPlugin = typeof githubActionsPlugin;
32
+ /** Default plugin export consumed by ESLint flat config. */
33
+ export default githubActionsPlugin;
34
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Public plugin entrypoint for eslint-plugin-github-actions-2.
4
+ */
5
+ import type { ESLint, Linter } from "eslint";
6
+ import { type GithubActionsConfigName } from "./_internal/github-actions-config-references.js";
7
+ import { githubActionsRules } from "./_internal/rules-registry.js";
8
+ /** Runtime type for the plugin's generated config presets. */
9
+ export type GithubActionsConfigs = Record<GithubActionsConfigName, GithubActionsPresetConfig>;
10
+ /** Flat config shape produced by this plugin. */
11
+ export type GithubActionsPresetConfig = Linter.Config & {
12
+ rules: NonNullable<Linter.Config["rules"]>;
13
+ };
14
+ /** Fully-qualified ESLint rule ids exposed by this plugin. */
15
+ export type GithubActionsRuleId = `github-actions/${GithubActionsRuleName}`;
16
+ /** Unqualified rule names supported by eslint-plugin-github-actions-2. */
17
+ export type GithubActionsRuleName = keyof typeof githubActionsRules;
18
+ /** Fully assembled plugin contract used by the runtime default export. */
19
+ type GithubActionsPluginContract = Omit<ESLint.Plugin, "configs" | "meta" | "rules"> & {
20
+ configs: GithubActionsConfigs;
21
+ meta: {
22
+ name: string;
23
+ namespace: string;
24
+ version: string;
25
+ };
26
+ rules: NonNullable<ESLint.Plugin["rules"]>;
27
+ };
28
+ /** Main plugin object exported for ESLint consumption. */
29
+ declare const githubActionsPlugin: GithubActionsPluginContract;
30
+ /** Runtime type for the plugin object exported as default. */
31
+ export type GithubActionsPlugin = typeof githubActionsPlugin;
32
+ /** Default plugin export consumed by ESLint flat config. */
33
+ export default githubActionsPlugin;
34
+ //# s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5D,eAAe,mBAAmB,CAAC"}
package/dist/plugin.js ADDED
@@ -0,0 +1,122 @@
1
+ import * as yamlParser from "yaml-eslint-parser";
2
+ import packageJson from "../package.json" with { type: "json" };
3
+ import { githubActionsConfigMetadataByName, githubActionsConfigNames, githubActionsConfigReferenceToName, } from "./_internal/github-actions-config-references.js";
4
+ import { githubActionsRules } from "./_internal/rules-registry.js";
5
+ /** ESLint severity used by generated preset rule maps. */
6
+ const ERROR_SEVERITY = "error";
7
+ /** Resolve package version from package.json data. */
8
+ function getPackageVersion(pkg) {
9
+ if (typeof pkg !== "object" || pkg === null) {
10
+ return "0.0.0";
11
+ }
12
+ const version = Reflect.get(pkg, "version");
13
+ return typeof version === "string" ? version : "0.0.0";
14
+ }
15
+ /** Determine whether a string is a valid config-reference token. */
16
+ const isGithubActionsConfigReference = (value) => Object.hasOwn(githubActionsConfigReferenceToName, value);
17
+ /** Normalize stored rule docs config references to a validated string array. */
18
+ const getRuleConfigReferences = (ruleName, rule) => {
19
+ const docs = rule.meta?.docs;
20
+ const references = docs?.configs;
21
+ const referenceList = Array.isArray(references) ? references : [references];
22
+ if (referenceList.length === 0 || referenceList[0] === undefined) {
23
+ throw new TypeError(`Rule '${ruleName}' is missing docs.configs preset metadata.`);
24
+ }
25
+ for (const reference of referenceList) {
26
+ if (typeof reference !== "string" ||
27
+ !isGithubActionsConfigReference(reference)) {
28
+ throw new TypeError(`Rule '${ruleName}' has an invalid config reference '${String(reference)}'.`);
29
+ }
30
+ }
31
+ return referenceList;
32
+ };
33
+ /** Strongly typed ESLint rule view of the internal registry. */
34
+ const githubActionsEslintRules = githubActionsRules;
35
+ /** Stable rule-entry list used by config derivation and docs tests. */
36
+ const githubActionsRuleEntries = Object.entries(githubActionsRules);
37
+ /** Build a config-to-rule-name map from rule docs metadata. */
38
+ const createPresetRuleNamesByConfig = () => {
39
+ const presetRuleNamesByConfig = {
40
+ actionMetadata: [],
41
+ all: [],
42
+ recommended: [],
43
+ security: [],
44
+ strict: [],
45
+ workflowTemplateProperties: [],
46
+ workflowTemplates: [],
47
+ };
48
+ for (const [ruleName, rule] of githubActionsRuleEntries) {
49
+ for (const reference of getRuleConfigReferences(ruleName, rule)) {
50
+ const configName = githubActionsConfigReferenceToName[reference];
51
+ if (configName === undefined) {
52
+ continue;
53
+ }
54
+ presetRuleNamesByConfig[configName].push(ruleName);
55
+ }
56
+ }
57
+ return presetRuleNamesByConfig;
58
+ };
59
+ /** Effective rule membership for every exported config preset. */
60
+ const presetRuleNamesByConfig = createPresetRuleNamesByConfig();
61
+ /** Build an ESLint rules map that enables each provided rule at error level. */
62
+ function errorRulesFor(ruleNames) {
63
+ const rules = {};
64
+ for (const ruleName of ruleNames) {
65
+ rules[`github-actions/${ruleName}`] = ERROR_SEVERITY;
66
+ }
67
+ return rules;
68
+ }
69
+ /** Apply YAML parser and plugin registration to a preset config fragment. */
70
+ function withGithubActionsPlugin(config, plugin) {
71
+ const existingLanguageOptions = config.languageOptions ?? {};
72
+ const existingParserOptions = existingLanguageOptions["parserOptions"];
73
+ return {
74
+ ...config,
75
+ languageOptions: {
76
+ ...existingLanguageOptions,
77
+ parser: existingLanguageOptions["parser"] ?? yamlParser,
78
+ parserOptions: existingParserOptions !== null &&
79
+ typeof existingParserOptions === "object" &&
80
+ !Array.isArray(existingParserOptions)
81
+ ? { ...existingParserOptions }
82
+ : {},
83
+ },
84
+ plugins: {
85
+ ...config.plugins,
86
+ "github-actions": plugin,
87
+ },
88
+ };
89
+ }
90
+ /** Minimal plugin view used while assembling exported presets. */
91
+ const pluginForConfigs = {
92
+ rules: githubActionsEslintRules,
93
+ };
94
+ /** Create every exported flat-config preset from static metadata. */
95
+ const createGithubActionsConfigsDefinition = () => {
96
+ const configs = {};
97
+ for (const configName of githubActionsConfigNames) {
98
+ const metadata = githubActionsConfigMetadataByName[configName];
99
+ configs[configName] = withGithubActionsPlugin({
100
+ files: [...metadata.files],
101
+ name: metadata.presetName,
102
+ rules: errorRulesFor(presetRuleNamesByConfig[configName]),
103
+ }, pluginForConfigs);
104
+ }
105
+ return configs;
106
+ };
107
+ /** Finalized typed view of all exported flat-config presets. */
108
+ const githubActionsConfigs = createGithubActionsConfigsDefinition();
109
+ /** Main plugin object exported for ESLint consumption. */
110
+ const githubActionsPlugin = {
111
+ configs: githubActionsConfigs,
112
+ meta: {
113
+ name: "eslint-plugin-github-actions-2",
114
+ namespace: "github-actions",
115
+ version: getPackageVersion(packageJson),
116
+ },
117
+ processors: {},
118
+ rules: githubActionsEslintRules,
119
+ };
120
+ /** Default plugin export consumed by ESLint flat config. */
121
+ export default githubActionsPlugin;
122
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAIjD,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChE,OAAO,EACH,iCAAiC,EAEjC,wBAAwB,EAExB,kCAAkC,GACrC,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,0DAA0D;AAC1D,MAAM,cAAc,GAAG,OAAgB,CAAC;AAoCxC,sDAAsD;AACtD,SAAS,iBAAiB,CAAC,GAAY;IACnC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QAC1C,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAE5C,OAAO,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;AAC3D,CAAC;AAED,oEAAoE;AACpE,MAAM,8BAA8B,GAAG,CACnC,KAAa,EACwB,EAAE,CACvC,MAAM,CAAC,MAAM,CAAC,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;QACD,OAAO,EAAE;YACL,GAAG,MAAM,CAAC,OAAO;YACjB,gBAAgB,EAAE,MAAM;SAC3B;KACJ,CAAC;AACN,CAAC;AAED,kEAAkE;AAClE,MAAM,gBAAgB,GAAkB;IACpC,KAAK,EAAE,wBAAwB;CAClC,CAAC;AAEF,qEAAqE;AACrE,MAAM,oCAAoC,GAAG,GAAyB,EAAE;IACpE,MAAM,OAAO,GAAG,EAA0B,CAAC;IAE3C,KAAK,MAAM,UAAU,IAAI,wBAAwB,EAAE,CAAC;QAChD,MAAM,QAAQ,GAAG,iCAAiC,CAAC,UAAU,CAAC,CAAC;QAE/D,OAAO,CAAC,UAAU,CAAC,GAAG,uBAAuB,CACzC;YACI,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;YAC1B,IAAI,EAAE,QAAQ,CAAC,UAAU;YACzB,KAAK,EAAE,aAAa,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC;SAC5D,EACD,gBAAgB,CACnB,CAAC;IACN,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AAEF,gEAAgE;AAChE,MAAM,oBAAoB,GACtB,oCAAoC,EAAE,CAAC;AAE3C,0DAA0D;AAC1D,MAAM,mBAAmB,GAAgC;IACrD,OAAO,EAAE,oBAAoB;IAC7B,IAAI,EAAE;QACF,IAAI,EAAE,gCAAgC;QACtC,SAAS,EAAE,gBAAgB;QAC3B,OAAO,EAAE,iBAAiB,CAAC,WAAW,CAAC;KAC1C;IACD,UAAU,EAAE,EAAE;IACd,KAAK,EAAE,wBAAwB;CAClC,CAAC;AAKF,4DAA4D;AAC5D,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Enforce a consistent naming convention for workflow names.
4
+ */
5
+ import type { Rule } from "eslint";
6
+ /** Rule implementation for enforcing workflow-name casing. */
7
+ declare const rule: Rule.RuleModule;
8
+ export default rule;
9
+ //# sourceMappingURL=action-name-casing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-name-casing.d.ts","sourceRoot":"","sources":["../../src/rules/action-name-casing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AA+DnC,8DAA8D;AAC9D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UA6IhB,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,141 @@
1
+ import { convertToGithubActionsCasing, githubActionsCasingKinds, matchesGithubActionsCasing, } from "../_internal/casing.js";
2
+ import { getMappingPair, getScalarStringValue, getWorkflowRoot, unwrapYamlValue, } from "../_internal/workflow-yaml.js";
3
+ /** Default casing enforced for workflow names. */
4
+ const DEFAULT_ACTION_NAME_CASING = "Title Case";
5
+ /**
6
+ * Normalize action-name-casing options into allowed casings and ignore
7
+ * patterns.
8
+ */
9
+ const normalizeActionNameCasingOptions = (option) => {
10
+ if (option === undefined || typeof option === "string") {
11
+ return {
12
+ allowedCasings: [option ?? DEFAULT_ACTION_NAME_CASING],
13
+ ignoredNames: [],
14
+ };
15
+ }
16
+ const allowedCasings = githubActionsCasingKinds.filter((casingKind) => option[casingKind] === true);
17
+ return {
18
+ allowedCasings: allowedCasings.length > 0
19
+ ? allowedCasings
20
+ : [DEFAULT_ACTION_NAME_CASING],
21
+ ignoredNames: [...(option.ignores ?? [])],
22
+ };
23
+ };
24
+ /** Rule implementation for enforcing workflow-name casing. */
25
+ const rule = {
26
+ create(context) {
27
+ const [option] = context.options;
28
+ const { allowedCasings, ignoredNames } = normalizeActionNameCasingOptions(option ?? undefined);
29
+ return {
30
+ Program() {
31
+ const root = getWorkflowRoot(context);
32
+ if (root === null) {
33
+ return;
34
+ }
35
+ const namePair = getMappingPair(root, "name");
36
+ const nameNode = unwrapYamlValue(namePair?.value ?? null);
37
+ const nameValue = getScalarStringValue(nameNode);
38
+ if (namePair === null ||
39
+ nameNode?.type !== "YAMLScalar" ||
40
+ nameValue === null ||
41
+ nameValue.trim().length === 0 ||
42
+ ignoredNames.includes(nameValue)) {
43
+ return;
44
+ }
45
+ const matchesAllowedCasing = allowedCasings.some((casingKind) => matchesGithubActionsCasing(nameValue, casingKind));
46
+ if (!matchesAllowedCasing) {
47
+ const [firstAllowedCasing] = allowedCasings;
48
+ context.report({
49
+ data: {
50
+ caseTypes: allowedCasings.join(", "),
51
+ name: nameValue,
52
+ },
53
+ fix: firstAllowedCasing !== undefined &&
54
+ allowedCasings.length === 1
55
+ ? (fixer) => fixer.replaceTextRange(nameNode.range, convertToGithubActionsCasing(nameValue, firstAllowedCasing))
56
+ : undefined,
57
+ messageId: "nameDoesNotMatchCasing",
58
+ node: nameNode,
59
+ });
60
+ }
61
+ },
62
+ };
63
+ },
64
+ meta: {
65
+ defaultOptions: [DEFAULT_ACTION_NAME_CASING],
66
+ docs: {
67
+ configs: [
68
+ "github-actions.configs.all",
69
+ "github-actions.configs.strict",
70
+ ],
71
+ description: "enforce a consistent casing convention for workflow `name` values.",
72
+ recommended: false,
73
+ requiresTypeChecking: false,
74
+ ruleId: "R009",
75
+ ruleNumber: 9,
76
+ url: "https://nick2bad4u.github.io/eslint-plugin-github-actions-2/docs/rules/action-name-casing",
77
+ },
78
+ fixable: "code",
79
+ messages: {
80
+ nameDoesNotMatchCasing: "Workflow name '{{name}}' is not in the configured casing: {{caseTypes}}.",
81
+ },
82
+ schema: [
83
+ {
84
+ anyOf: [
85
+ {
86
+ description: "Single allowed casing convention for the workflow `name` value.",
87
+ enum: githubActionsCasingKinds,
88
+ type: "string",
89
+ },
90
+ {
91
+ additionalProperties: false,
92
+ description: "Allowed casing conventions and ignore patterns for the workflow `name` value.",
93
+ properties: {
94
+ camelCase: {
95
+ description: "Allow camelCase workflow names.",
96
+ type: "boolean",
97
+ },
98
+ ignores: {
99
+ description: "Literal workflow names that should be ignored by this rule.",
100
+ items: {
101
+ type: "string",
102
+ },
103
+ type: "array",
104
+ uniqueItems: true,
105
+ },
106
+ "kebab-case": {
107
+ description: "Allow kebab-case workflow names.",
108
+ type: "boolean",
109
+ },
110
+ PascalCase: {
111
+ description: "Allow PascalCase workflow names.",
112
+ type: "boolean",
113
+ },
114
+ SCREAMING_SNAKE_CASE: {
115
+ description: "Allow SCREAMING_SNAKE_CASE workflow names.",
116
+ type: "boolean",
117
+ },
118
+ snake_case: {
119
+ description: "Allow snake_case workflow names.",
120
+ type: "boolean",
121
+ },
122
+ "Title Case": {
123
+ description: "Allow Title Case workflow names.",
124
+ type: "boolean",
125
+ },
126
+ "Train-Case": {
127
+ description: "Allow Train-Case workflow names.",
128
+ type: "boolean",
129
+ },
130
+ },
131
+ type: "object",
132
+ },
133
+ ],
134
+ description: "Configure one or more allowed casing conventions for workflow `name` values.",
135
+ },
136
+ ],
137
+ type: "suggestion",
138
+ },
139
+ };
140
+ export default rule;
141
+ //# sourceMappingURL=action-name-casing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-name-casing.js","sourceRoot":"","sources":["../../src/rules/action-name-casing.ts"],"names":[],"mappings":"AAOA,OAAO,EACH,4BAA4B,EAE5B,wBAAwB,EACxB,0BAA0B,GAC7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACH,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,eAAe,GAClB,MAAM,+BAA+B,CAAC;AAcvC,kDAAkD;AAClD,MAAM,0BAA0B,GAA4B,YAAY,CAAC;AAEzE;;;GAGG;AACH,MAAM,gCAAgC,GAAG,CACrC,MAEC,EAIH,EAAE;IACA,IAAI,MAAM,KAAK,SAAS,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QACrD,OAAO;YACH,cAAc,EAAE,CAAC,MAAM,IAAI,0BAA0B,CAAC;YACtD,YAAY,EAAE,EAAE;SACnB,CAAC;IACN,CAAC;IAED,MAAM,cAAc,GAAG,wBAAwB,CAAC,MAAM,CAClD,CAAC,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,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AAW,EACP,6DAA6D;gCACjE,KAAK,EAAE;oCACH,IAAI,EAAE,QAAQ;iCACjB;gCACD,IAAI,EAAE,OAAO;gCACb,WAAW,EAAE,IAAI;6BACpB;4BACD,YAAY,EAAE;gCACV,WAAW,EAAE,kCAAkC;gCAC/C,IAAI,EAAE,SAAS;6BAClB;4BACD,UAAU,EAAE;gCACR,WAAW,EAAE,kCAAkC;gCAC/C,IAAI,EAAE,SAAS;6BAClB;4BACD,oBAAoB,EAAE;gCAClB,WAAW,EACP,4CAA4C;gCAChD,IAAI,EAAE,SAAS;6BAClB;4BACD,UAAU,EAAE;gCACR,WAAW,EAAE,kCAAkC;gCAC/C,IAAI,EAAE,SAAS;6BAClB;4BACD,YAAY,EAAE;gCACV,WAAW,EAAE,kCAAkC;gCAC/C,IAAI,EAAE,SAAS;6BAClB;4BACD,YAAY,EAAE;gCACV,WAAW,EAAE,kCAAkC;gCAC/C,IAAI,EAAE,SAAS;6BAClB;yBACJ;wBACD,IAAI,EAAE,QAAQ;qBACjB;iBACJ;gBACD,WAAW,EACP,8EAA8E;aACrF;SACJ;QACD,IAAI,EAAE,YAAY;KACA;CACzB,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Enforce a consistent naming convention for workflow job identifiers.
4
+ */
5
+ import type { Rule } from "eslint";
6
+ /** Rule implementation for enforcing job-id casing. */
7
+ declare const rule: Rule.RuleModule;
8
+ export default rule;
9
+ //# sourceMappingURL=job-id-casing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"job-id-casing.d.ts","sourceRoot":"","sources":["../../src/rules/job-id-casing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAwDnC,uDAAuD;AACvD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAoHhB,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,123 @@
1
+ import { githubActionsNonTitleCasingKinds, matchesGithubActionsCasing, } from "../_internal/casing.js";
2
+ import { getWorkflowJobs, getWorkflowRoot, } from "../_internal/workflow-yaml.js";
3
+ /** Default casing enforced for workflow job ids. */
4
+ const DEFAULT_JOB_ID_CASING = "kebab-case";
5
+ /** Normalize job-id-casing options into allowed casings and ignore patterns. */
6
+ const normalizeJobIdCasingOptions = (option) => {
7
+ if (option === undefined || typeof option === "string") {
8
+ return {
9
+ allowedCasings: [option ?? DEFAULT_JOB_ID_CASING],
10
+ ignoredJobIds: [],
11
+ };
12
+ }
13
+ const allowedCasings = githubActionsNonTitleCasingKinds.filter((casingKind) => option[casingKind] === true);
14
+ return {
15
+ allowedCasings: allowedCasings.length > 0
16
+ ? allowedCasings
17
+ : [DEFAULT_JOB_ID_CASING],
18
+ ignoredJobIds: [...(option.ignores ?? [])],
19
+ };
20
+ };
21
+ /** Rule implementation for enforcing job-id casing. */
22
+ const rule = {
23
+ create(context) {
24
+ const [option] = context.options;
25
+ const { allowedCasings, ignoredJobIds } = normalizeJobIdCasingOptions(option ?? undefined);
26
+ return {
27
+ Program() {
28
+ const root = getWorkflowRoot(context);
29
+ if (root === null) {
30
+ return;
31
+ }
32
+ for (const job of getWorkflowJobs(root)) {
33
+ if (ignoredJobIds.includes(job.id)) {
34
+ continue;
35
+ }
36
+ const matchesAllowedCasing = allowedCasings.some((casingKind) => matchesGithubActionsCasing(job.id, casingKind));
37
+ if (!matchesAllowedCasing) {
38
+ context.report({
39
+ data: {
40
+ caseTypes: allowedCasings.join(", "),
41
+ jobId: job.id,
42
+ },
43
+ messageId: "jobIdDoesNotMatchCasing",
44
+ node: job.idNode,
45
+ });
46
+ }
47
+ }
48
+ },
49
+ };
50
+ },
51
+ meta: {
52
+ defaultOptions: [DEFAULT_JOB_ID_CASING],
53
+ docs: {
54
+ configs: [
55
+ "github-actions.configs.all",
56
+ "github-actions.configs.strict",
57
+ ],
58
+ description: "enforce a consistent casing convention for workflow job identifiers.",
59
+ recommended: false,
60
+ requiresTypeChecking: false,
61
+ ruleId: "R010",
62
+ ruleNumber: 10,
63
+ url: "https://nick2bad4u.github.io/eslint-plugin-github-actions-2/docs/rules/job-id-casing",
64
+ },
65
+ messages: {
66
+ jobIdDoesNotMatchCasing: "Job id '{{jobId}}' is not in the configured casing: {{caseTypes}}.",
67
+ },
68
+ schema: [
69
+ {
70
+ anyOf: [
71
+ {
72
+ description: "Single allowed casing convention for workflow job ids.",
73
+ enum: githubActionsNonTitleCasingKinds,
74
+ type: "string",
75
+ },
76
+ {
77
+ additionalProperties: false,
78
+ description: "Allowed casing conventions and ignore patterns for workflow job ids.",
79
+ properties: {
80
+ camelCase: {
81
+ description: "Allow camelCase job ids.",
82
+ type: "boolean",
83
+ },
84
+ ignores: {
85
+ description: "Literal job ids that should be ignored by this rule.",
86
+ items: {
87
+ type: "string",
88
+ },
89
+ type: "array",
90
+ uniqueItems: true,
91
+ },
92
+ "kebab-case": {
93
+ description: "Allow kebab-case job ids.",
94
+ type: "boolean",
95
+ },
96
+ PascalCase: {
97
+ description: "Allow PascalCase job ids.",
98
+ type: "boolean",
99
+ },
100
+ SCREAMING_SNAKE_CASE: {
101
+ description: "Allow SCREAMING_SNAKE_CASE job ids.",
102
+ type: "boolean",
103
+ },
104
+ snake_case: {
105
+ description: "Allow snake_case job ids.",
106
+ type: "boolean",
107
+ },
108
+ "Train-Case": {
109
+ description: "Allow Train-Case job ids.",
110
+ type: "boolean",
111
+ },
112
+ },
113
+ type: "object",
114
+ },
115
+ ],
116
+ description: "Configure one or more allowed casing conventions for workflow job ids.",
117
+ },
118
+ ],
119
+ type: "suggestion",
120
+ },
121
+ };
122
+ export default rule;
123
+ //# sourceMappingURL=job-id-casing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"job-id-casing.js","sourceRoot":"","sources":["../../src/rules/job-id-casing.ts"],"names":[],"mappings":"AAMA,OAAO,EAEH,gCAAgC,EAChC,0BAA0B,GAC7B,MAAM,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gCACD,IAAI,EAAE,OAAO;gCACb,WAAW,EAAE,IAAI;6BACpB;4BACD,YAAY,EAAE;gCACV,WAAW,EAAE,2BAA2B;gCACxC,IAAI,EAAE,SAAS;6BAClB;4BACD,UAAU,EAAE;gCACR,WAAW,EAAE,2BAA2B;gCACxC,IAAI,EAAE,SAAS;6BAClB;4BACD,oBAAoB,EAAE;gCAClB,WAAW,EACP,qCAAqC;gCACzC,IAAI,EAAE,SAAS;6BAClB;4BACD,UAAU,EAAE;gCACR,WAAW,EAAE,2BAA2B;gCACxC,IAAI,EAAE,SAAS;6BAClB;4BACD,YAAY,EAAE;gCACV,WAAW,EAAE,2BAA2B;gCACxC,IAAI,EAAE,SAAS;6BAClB;yBACJ;wBACD,IAAI,EAAE,QAAQ;qBACjB;iBACJ;gBACD,WAAW,EACP,wEAAwE;aAC/E;SACJ;QACD,IAAI,EAAE,YAAY;KACA;CACzB,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Enforce an upper bound on the number of jobs declared in one workflow file.
4
+ */
5
+ import type { Rule } from "eslint";
6
+ /** Rule implementation for limiting workflow job counts. */
7
+ declare const rule: Rule.RuleModule;
8
+ export default rule;
9
+ //# sourceMappingURL=max-jobs-per-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"max-jobs-per-action.d.ts","sourceRoot":"","sources":["../../src/rules/max-jobs-per-action.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAanC,4DAA4D;AAC5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAiEhB,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,61 @@
1
+ import { getMappingValueAsMapping, getWorkflowRoot, } from "../_internal/workflow-yaml.js";
2
+ /** Default maximum number of jobs allowed in a single workflow file. */
3
+ const DEFAULT_MAX_JOBS = 3;
4
+ /** Rule implementation for limiting workflow job counts. */
5
+ const rule = {
6
+ create(context) {
7
+ const [configuredMaxJobs = DEFAULT_MAX_JOBS] = context.options;
8
+ const maxJobs = configuredMaxJobs >= 1 ? configuredMaxJobs : DEFAULT_MAX_JOBS;
9
+ return {
10
+ Program() {
11
+ const root = getWorkflowRoot(context);
12
+ if (root === null) {
13
+ return;
14
+ }
15
+ const jobsMapping = getMappingValueAsMapping(root, "jobs");
16
+ if (jobsMapping === null) {
17
+ return;
18
+ }
19
+ const jobCount = jobsMapping.pairs.length;
20
+ if (jobCount > maxJobs) {
21
+ context.report({
22
+ data: {
23
+ count: String(jobCount),
24
+ limit: String(maxJobs),
25
+ },
26
+ messageId: "tooManyJobs",
27
+ node: jobsMapping,
28
+ });
29
+ }
30
+ },
31
+ };
32
+ },
33
+ meta: {
34
+ defaultOptions: [DEFAULT_MAX_JOBS],
35
+ docs: {
36
+ configs: [
37
+ "github-actions.configs.all",
38
+ "github-actions.configs.strict",
39
+ ],
40
+ description: "enforce a maximum number of jobs per workflow file so large pipelines stay modular and reviewable.",
41
+ recommended: false,
42
+ requiresTypeChecking: false,
43
+ ruleId: "R011",
44
+ ruleNumber: 11,
45
+ url: "https://nick2bad4u.github.io/eslint-plugin-github-actions-2/docs/rules/max-jobs-per-action",
46
+ },
47
+ messages: {
48
+ tooManyJobs: "This workflow defines {{count}} jobs, which exceeds the configured maximum of {{limit}}.",
49
+ },
50
+ schema: [
51
+ {
52
+ description: "Maximum number of jobs allowed in a single GitHub Actions workflow file.",
53
+ minimum: 1,
54
+ type: "integer",
55
+ },
56
+ ],
57
+ type: "suggestion",
58
+ },
59
+ };
60
+ export default rule;
61
+ //# sourceMappingURL=max-jobs-per-action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"max-jobs-per-action.js","sourceRoot":"","sources":["../../src/rules/max-jobs-per-action.ts"],"names":[],"mappings":"AAMA,OAAO,EACH,wBAAwB,EACxB,eAAe,GAClB,MAAM,+BAA+B,CAAC;AAKvC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,QAAQ,EAAE;YACN,WAAW,EACP,0FAA0F;SACjG;QACD,MAAM,EAAE;YACJ;gBACI,WAAW,EACP,0EAA0E;gBAC9E,OAAO,EAAE,CAAC;gBACV,IAAI,EAAE,SAAS;aAClB;SACJ;QACD,IAAI,EAAE,YAAY;KACA;CACzB,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Disallow case-insensitive collisions between action input ids.
4
+ */
5
+ import type { Rule } from "eslint";
6
+ /** Rule implementation for case-insensitive input id collision detection. */
7
+ declare const rule: Rule.RuleModule;
8
+ export default rule;
9
+ //# sourceMappingURL=no-case-insensitive-input-id-collision.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-case-insensitive-input-id-collision.d.ts","sourceRoot":"","sources":["../../src/rules/no-case-insensitive-input-id-collision.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AASnC,6EAA6E;AAC7E,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UA0EhB,CAAC;AAEF,eAAe,IAAI,CAAC"}