mega-linter-runner 9.4.0 → 9.5.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/README.md +28 -26
- package/generators/mega-linter/index.js +9 -0
- package/generators/mega-linter/templates/mega-linter.yml +21 -2
- package/generators/mega-linter-custom-flavor/templates/README.md +8 -2
- package/generators/mega-linter-custom-flavor/templates/check-new-megalinter-version.yml +27 -38
- package/generators/mega-linter-custom-flavor/templates/megalinter-custom-flavor-builder.yml +19 -8
- package/lib/env-parser.js +28 -0
- package/lib/list-vars.js +100 -0
- package/lib/megalinter-vars.json +29720 -0
- package/lib/options.js +97 -32
- package/lib/runner.js +21 -4
- package/package.json +8 -5
package/README.md
CHANGED
|
@@ -179,7 +179,7 @@ You can generate a ready-to-use [.mega-linter.yml configuration file](https://me
|
|
|
179
179
|
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/javascript.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**JAVASCRIPT**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/javascript.md) | [**eslint**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/javascript_eslint.md)<br/>[_JAVASCRIPT_ES_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/javascript_eslint.md) | [](https://github.com/eslint/eslint)   |
|
|
180
180
|
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/javascript.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**JAVASCRIPT**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/javascript.md) | [**standard**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/javascript_standard.md)<br/>[_JAVASCRIPT_STANDARD_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/javascript_standard.md) | [](https://github.com/standard/standard)  |
|
|
181
181
|
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/javascript.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**JAVASCRIPT**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/javascript.md) | [**prettier**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/javascript_prettier.md)<br/>[_JAVASCRIPT_PRETTIER_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/javascript_prettier.md) | [](https://github.com/prettier/prettier)  |
|
|
182
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/jsx.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**JSX**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/jsx.md) | [**eslint**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/jsx_eslint.md)<br/>[_JSX_ESLINT_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/jsx_eslint.md) |
|
|
182
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/jsx.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**JSX**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/jsx.md) | [**eslint**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/jsx_eslint.md)<br/>[_JSX_ESLINT_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/jsx_eslint.md) | [](https://github.com/Rel1cx/eslint-react)   |
|
|
183
183
|
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/kotlin.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**KOTLIN**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/kotlin.md) | [**ktlint**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/kotlin_ktlint.md)<br/>[_KOTLIN_KTLINT_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/kotlin_ktlint.md) | [](https://github.com/pinterest/ktlint)   |
|
|
184
184
|
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/kotlin.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**KOTLIN**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/kotlin.md) | [**detekt**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/kotlin_detekt.md)<br/>[_KOTLIN_DETEKT_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/kotlin_detekt.md) | [](https://github.com/detekt/detekt)  |
|
|
185
185
|
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/lua.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**LUA**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/lua.md) | [**luacheck**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/lua_luacheck.md)<br/>[_LUA_LUACHECK_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/lua_luacheck.md) | [](https://github.com/lunarmodules/luacheck) |
|
|
@@ -219,7 +219,7 @@ You can generate a ready-to-use [.mega-linter.yml configuration file](https://me
|
|
|
219
219
|
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/sql.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**SQL**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/sql.md) | [**sqlfluff**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/sql_sqlfluff.md)<br/>[_SQL_SQLFLUFF_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/sql_sqlfluff.md) | [](https://github.com/sqlfluff/sqlfluff)  |
|
|
220
220
|
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/sql.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**SQL**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/sql.md) | [**tsqllint**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/sql_tsqllint.md)<br/>[_SQL_TSQLLINT_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/sql_tsqllint.md) | [](https://github.com/tsqllint/tsqllint) |
|
|
221
221
|
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/swift.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**SWIFT**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/swift.md) | [**swiftlint**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/swift_swiftlint.md)<br/>[_SWIFT_SWIFTLINT_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/swift_swiftlint.md) | [](https://github.com/realm/SwiftLint)  |
|
|
222
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/tsx.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**TSX**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/tsx.md) | [**eslint**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/tsx_eslint.md)<br/>[_TSX_ESLINT_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/tsx_eslint.md) |
|
|
222
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/tsx.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**TSX**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/tsx.md) | [**eslint**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/tsx_eslint.md)<br/>[_TSX_ESLINT_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/tsx_eslint.md) | [](https://github.com/Rel1cx/eslint-react)   |
|
|
223
223
|
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/typescript.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**TYPESCRIPT**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/typescript.md) | [**eslint**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/typescript_eslint.md)<br/>[_TYPESCRIPT_ES_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/typescript_eslint.md) | [](https://github.com/typescript-eslint/typescript-eslint)   |
|
|
224
224
|
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/typescript.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**TYPESCRIPT**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/typescript.md) | [**ts-standard**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/typescript_ts_standard.md)<br/>[_TYPESCRIPT_STANDARD_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/typescript_ts_standard.md) | [](https://github.com/standard/ts-standard)  |
|
|
225
225
|
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/typescript.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**TYPESCRIPT**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/typescript.md) | [**prettier**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/typescript_prettier.md)<br/>[_TYPESCRIPT_PRETTIER_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/typescript_prettier.md) | [](https://github.com/prettier/prettier)  |
|
|
@@ -258,8 +258,9 @@ You can generate a ready-to-use [.mega-linter.yml configuration file](https://me
|
|
|
258
258
|
| <!-- --> | Tooling format | Linter | Additional |
|
|
259
259
|
|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|-------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|
260
260
|
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**ACTION**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/action.md) | [**actionlint**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/action_actionlint.md)<br/>[_ACTION_ACTIONLINT_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/action_actionlint.md) | [](https://github.com/rhysd/actionlint) |
|
|
261
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**ACTION**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/action.md) | [**zizmor**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/action_zizmor.md)<br/>[_ACTION_ZIZMOR_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/action_zizmor.md) | [](https://github.com/zizmorcore/zizmor)  |
|
|
261
262
|
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/ansible.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**ANSIBLE**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/ansible.md) | [**ansible-lint**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/ansible_ansible_lint.md)<br/>[_ANSIBLE_ANSIBLE_LINT_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/ansible_ansible_lint.md) | [](https://github.com/ansible/ansible-lint)  |
|
|
262
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**API**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/api.md) | [**spectral**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/api_spectral.md)<br/>[_API_SPECTRAL_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/api_spectral.md) |
|
|
263
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**API**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/api.md) | [**spectral**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/api_spectral.md)<br/>[_API_SPECTRAL_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/api_spectral.md) |  [](https://github.com/stoplightio/spectral)  |
|
|
263
264
|
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/arm.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**ARM**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/arm.md) | [**arm-ttk**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/arm_arm_ttk.md)<br/>[_ARM_ARM_TTK_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/arm_arm_ttk.md) | [](https://github.com/Azure/arm-ttk) |
|
|
264
265
|
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**BICEP**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/bicep.md) | [**bicep_linter**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/bicep_bicep_linter.md)<br/>[_BICEP_BICEP_LINTER_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/bicep_bicep_linter.md) | [](https://github.com/Azure/bicep) |
|
|
265
266
|
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/cloudformation.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**CLOUDFORMATION**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/cloudformation.md) | [**cfn-lint**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/cloudformation_cfn_lint.md)<br/>[_CLOUDFORMATION_CFN_LINT_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/cloudformation_cfn_lint.md) | [](https://github.com/aws-cloudformation/cfn-lint)  |
|
|
@@ -281,29 +282,30 @@ You can generate a ready-to-use [.mega-linter.yml configuration file](https://me
|
|
|
281
282
|
|
|
282
283
|
### Other
|
|
283
284
|
|
|
284
|
-
| <!-- --> | Code quality checker | Linter
|
|
285
|
-
|
|
286
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/copypaste.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**COPYPASTE**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/copypaste.md) | [**jscpd**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/copypaste_jscpd.md)<br/>[_COPYPASTE_JSCPD_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/copypaste_jscpd.md)
|
|
287
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**checkov**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_checkov.md)<br/>[_REPOSITORY_CHECKOV_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_checkov.md)
|
|
288
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**devskim**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_devskim.md)<br/>[_REPOSITORY_DEVSKIM_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_devskim.md)
|
|
289
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**dustilock**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_dustilock.md)<br/>[_REPOSITORY_DUSTILOCK_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_dustilock.md)
|
|
290
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**git_diff**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_git_diff.md)<br/>[_REPOSITORY_GIT_DIFF_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_git_diff.md)
|
|
291
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**gitleaks**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_gitleaks.md)<br/>[_REPOSITORY_GITLEAKS_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_gitleaks.md)
|
|
292
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**grype**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_grype.md)<br/>[_REPOSITORY_GRYPE_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_grype.md)
|
|
293
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**kics**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_kics.md)<br/>[_REPOSITORY_KICS_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_kics.md)
|
|
294
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**ls-lint**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_ls_lint.md)<br/>[_REPOSITORY_LS_LINT_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_ls_lint.md)
|
|
295
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**
|
|
296
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**
|
|
297
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**
|
|
298
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**
|
|
299
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**trivy
|
|
300
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**
|
|
301
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**
|
|
302
|
-
|
|
|
303
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/spell.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**SPELL**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell.md) | [**
|
|
304
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/spell.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**SPELL**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell.md) | [**
|
|
305
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/spell.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**SPELL**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell.md) | [**
|
|
306
|
-
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/spell.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**SPELL**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell.md) | [**
|
|
285
|
+
| <!-- --> | Code quality checker | Linter | Additional |
|
|
286
|
+
|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------:|-----------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|
287
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/copypaste.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**COPYPASTE**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/copypaste.md) | [**jscpd**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/copypaste_jscpd.md)<br/>[_COPYPASTE_JSCPD_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/copypaste_jscpd.md) | [](https://github.com/kucherenko/jscpd) |
|
|
288
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**checkov**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_checkov.md)<br/>[_REPOSITORY_CHECKOV_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_checkov.md) | [](https://github.com/bridgecrewio/checkov)  |
|
|
289
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**devskim**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_devskim.md)<br/>[_REPOSITORY_DEVSKIM_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_devskim.md) | [](https://github.com/microsoft/DevSkim)  |
|
|
290
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**dustilock**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_dustilock.md)<br/>[_REPOSITORY_DUSTILOCK_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_dustilock.md) | [](https://github.com/Checkmarx/dustilock)  |
|
|
291
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**git_diff**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_git_diff.md)<br/>[_REPOSITORY_GIT_DIFF_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_git_diff.md) | [](https://github.com/git/git) |
|
|
292
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**gitleaks**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_gitleaks.md)<br/>[_REPOSITORY_GITLEAKS_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_gitleaks.md) | [](https://github.com/gitleaks/gitleaks)  |
|
|
293
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**grype**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_grype.md)<br/>[_REPOSITORY_GRYPE_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_grype.md) |  [](https://github.com/anchore/grype)  |
|
|
294
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**kics**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_kics.md)<br/>[_REPOSITORY_KICS_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_kics.md) |  [](https://github.com/checkmarx/kics)  |
|
|
295
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**ls-lint**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_ls_lint.md)<br/>[_REPOSITORY_LS_LINT_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_ls_lint.md) | [](https://github.com/loeffel-io/ls-lint) |
|
|
296
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**osv-scanner**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_osv_scanner.md)<br/>[_REPOSITORY_OSV_SCANNER_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_osv_scanner.md) | [](https://github.com/google/osv-scanner) |
|
|
297
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**secretlint**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_secretlint.md)<br/>[_REPOSITORY_SECRETLINT_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_secretlint.md) | [](https://github.com/secretlint/secretlint)  |
|
|
298
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**semgrep**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_semgrep.md)<br/>[_REPOSITORY_SEMGREP_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_semgrep.md) | [](https://github.com/returntocorp/semgrep)  |
|
|
299
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**syft**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_syft.md)<br/>[_REPOSITORY_SYFT_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_syft.md) | [](https://github.com/anchore/syft)  |
|
|
300
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**trivy**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_trivy.md)<br/>[_REPOSITORY_TRIVY_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_trivy.md) | [](https://github.com/aquasecurity/trivy)  |
|
|
301
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**trivy-sbom**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_trivy_sbom.md)<br/>[_REPOSITORY_TRIVY_SBOM_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_trivy_sbom.md) | [](https://github.com/aquasecurity/trivy)  |
|
|
302
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**trufflehog**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_trufflehog.md)<br/>[_REPOSITORY_TRUFFLEHOG_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_trufflehog.md) | [](https://github.com/trufflesecurity/trufflehog) |
|
|
303
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/default.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**REPOSITORY**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository.md) | [**kingfisher**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_kingfisher.md)<br/>[_REPOSITORY_KINGFISHER_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/repository_kingfisher.md) | [](https://github.com/mongodb/kingfisher)  |
|
|
304
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/spell.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**SPELL**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell.md) | [**cspell**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell_cspell.md)<br/>[_SPELL_CSPELL_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell_cspell.md) | [](https://github.com/streetsidesoftware/cspell) |
|
|
305
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/spell.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**SPELL**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell.md) | [**proselint**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell_proselint.md)<br/>[_SPELL_PROSELINT_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell_proselint.md) | [](https://github.com/amperser/proselint) |
|
|
306
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/spell.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**SPELL**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell.md) | [**vale**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell_vale.md)<br/>[_SPELL_VALE_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell_vale.md) | [](https://github.com/errata-ai/vale) |
|
|
307
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/spell.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**SPELL**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell.md) | [**lychee**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell_lychee.md)<br/>[_SPELL_LYCHEE_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell_lychee.md) | [](https://github.com/lycheeverse/lychee) |
|
|
308
|
+
| <img src="https://github.com/oxsecurity/megalinter/raw/main/docs/assets/icons/spell.ico" alt="" height="32px" class="megalinter-icon"></a> <!-- linter-icon --> | [**SPELL**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell.md) | [**codespell**](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell_codespell.md)<br/>[_SPELL_CODESPELL_](https://github.com/oxsecurity/megalinter/tree/main/docs/descriptors/spell_codespell.md) | [](https://github.com/codespell-project/codespell)  |
|
|
307
309
|
|
|
308
310
|
<!-- linters-table-end -->
|
|
309
311
|
|
|
@@ -191,6 +191,14 @@ When you don't know what option to select, please use default values`
|
|
|
191
191
|
this.validateAllCodeBaseGha += " github.ref == 'refs/heads/main'"
|
|
192
192
|
this.validateAllCodeBaseGha += " }}";
|
|
193
193
|
}
|
|
194
|
+
// persist-credentials
|
|
195
|
+
if (this.props.applyFixes === true) {
|
|
196
|
+
this.persistCredentials =
|
|
197
|
+
"# persist-credentials: false # Comment this line and uncomment the next one if you use APPLY_FIXES\n persist-credentials: true # zizmor: ignore[artipacked]";
|
|
198
|
+
} else {
|
|
199
|
+
this.persistCredentials =
|
|
200
|
+
"persist-credentials: false # Comment this line and uncomment the next one if you use APPLY_FIXES\n # persist-credentials: true # zizmor: ignore[artipacked]";
|
|
201
|
+
}
|
|
194
202
|
this.disable = false;
|
|
195
203
|
// COPY PASTES
|
|
196
204
|
if (this.props.copyPaste === true) {
|
|
@@ -224,6 +232,7 @@ When you don't know what option to select, please use default values`
|
|
|
224
232
|
DEFAULT_BRANCH: this.props.defaultBranch,
|
|
225
233
|
GITHUB_ACTION_NAME: this.gitHubActionName,
|
|
226
234
|
GITHUB_ACTION_VERSION: this.gitHubActionVersion,
|
|
235
|
+
PERSIST_CREDENTIALS: this.persistCredentials,
|
|
227
236
|
VALIDATE_ALL_CODE_BASE_GHA: this.validateAllCodeBaseGha,
|
|
228
237
|
}
|
|
229
238
|
);
|
|
@@ -35,6 +35,8 @@ concurrency:
|
|
|
35
35
|
group: ${{ github.ref }}-${{ github.workflow }}
|
|
36
36
|
cancel-in-progress: true
|
|
37
37
|
|
|
38
|
+
permissions: {}
|
|
39
|
+
|
|
38
40
|
jobs:
|
|
39
41
|
megalinter:
|
|
40
42
|
name: MegaLinter
|
|
@@ -52,7 +54,17 @@ jobs:
|
|
|
52
54
|
- name: Checkout Code
|
|
53
55
|
uses: actions/checkout@v6
|
|
54
56
|
with:
|
|
57
|
+
# SECURITY NOTE: Using a Personal Access Token (PAT) is NOT
|
|
58
|
+
# recommended. Open-source projects have been heavily targeted by
|
|
59
|
+
# supply-chain attacks in recent months, and a leaked PAT can give
|
|
60
|
+
# attackers broad write access to your repository — better safe
|
|
61
|
+
# than sorry! If you only need workflows to re-trigger after
|
|
62
|
+
# MegaLinter applies fixes, prefer one of these safer alternatives:
|
|
63
|
+
# - Manually re-run the workflow from the GitHub Actions tab, or
|
|
64
|
+
# - Push another commit on the branch to trigger workflows again.
|
|
65
|
+
# Only define `secrets.PAT` if you fully understand the trade-off.
|
|
55
66
|
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
|
|
67
|
+
<%- PERSIST_CREDENTIALS %>
|
|
56
68
|
|
|
57
69
|
# If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to
|
|
58
70
|
# improve performance
|
|
@@ -139,6 +151,10 @@ jobs:
|
|
|
139
151
|
) &&
|
|
140
152
|
!contains(github.event.head_commit.message, 'skip fix')
|
|
141
153
|
with:
|
|
154
|
+
# SECURITY NOTE: see the warning on the checkout step above —
|
|
155
|
+
# using `secrets.PAT` is NOT recommended for security reasons.
|
|
156
|
+
# Prefer manually re-running the workflow or pushing another
|
|
157
|
+
# commit on the branch to trigger workflows again.
|
|
142
158
|
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
|
|
143
159
|
commit-message: "[MegaLinter] Apply linters automatic fixes"
|
|
144
160
|
title: "[MegaLinter] Apply linters automatic fixes"
|
|
@@ -157,9 +173,12 @@ jobs:
|
|
|
157
173
|
github.event.pull_request.head.repo.full_name == github.repository
|
|
158
174
|
) &&
|
|
159
175
|
!contains(github.event.head_commit.message, 'skip fix')
|
|
176
|
+
env:
|
|
177
|
+
PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }}
|
|
178
|
+
PR_URL: ${{ steps.cpr.outputs.pull-request-url }}
|
|
160
179
|
run: |
|
|
161
|
-
echo "PR Number - ${
|
|
162
|
-
echo "PR URL - ${
|
|
180
|
+
echo "PR Number - ${PR_NUMBER}"
|
|
181
|
+
echo "PR URL - ${PR_URL}"
|
|
163
182
|
|
|
164
183
|
# Push new commit if applicable
|
|
165
184
|
# (for now works only on PR from same repository, not from forks)
|
|
@@ -33,14 +33,20 @@ This custom flavor is automatically kept up to date with MegaLinter releases:
|
|
|
33
33
|
|
|
34
34
|
## Configuration requirements
|
|
35
35
|
|
|
36
|
-
###
|
|
36
|
+
### Optional: Personal Access Token (use with care)
|
|
37
|
+
|
|
38
|
+
> **Security warning**: Using a Personal Access Token (PAT) is **not recommended**. Open-source projects have been heavily targeted by supply-chain attacks in recent months, and a leaked or compromised PAT can give attackers broad write access to your repository — better safe than sorry!
|
|
39
|
+
> If you do not need fully automatic daily version sync, you can skip the PAT entirely and trigger the `check-new-megalinter-version` workflow manually whenever you want to upgrade.
|
|
40
|
+
|
|
41
|
+
If you decide automatic daily releases are worth the trade-off, configure a `PAT_TOKEN` secret as a **repository-scoped fine-grained token** with:
|
|
37
42
|
|
|
38
|
-
For automatic version checking to work, a `PAT_TOKEN` secret must be configured as a **repository-scoped fine-grained token** with:
|
|
39
43
|
- **Repository access**: Only select repositories (select this repository)
|
|
40
44
|
- **Repository permissions**:
|
|
41
45
|
- Contents: Read and write
|
|
42
46
|
- Actions: Read and write
|
|
43
47
|
|
|
48
|
+
Rotate the token regularly.
|
|
49
|
+
|
|
44
50
|
See the [Custom Flavors documentation](https://megalinter.io/beta/custom-flavors/) for detailed setup instructions.
|
|
45
51
|
|
|
46
52
|
### Optional: Docker Hub publishing
|
|
@@ -26,7 +26,17 @@
|
|
|
26
26
|
# This is required to trigger the builder workflow. Without it, the workflow
|
|
27
27
|
# will fail and the release will be deleted (to be recreated once the token is set).
|
|
28
28
|
#
|
|
29
|
-
#
|
|
29
|
+
# SECURITY WARNING: Using a PAT comes with risk. Open-source projects have been
|
|
30
|
+
# heavily targeted by supply-chain attacks in recent months, and a leaked or
|
|
31
|
+
# compromised PAT can give attackers broad write access to your repository —
|
|
32
|
+
# better safe than sorry! If you do not need fully automatic daily version
|
|
33
|
+
# sync, you can skip the PAT entirely and trigger this workflow manually
|
|
34
|
+
# (Actions tab → "Check for New MegaLinter Version" → "Run workflow") whenever
|
|
35
|
+
# you want to bump to a new MegaLinter release. Only configure PAT_TOKEN if
|
|
36
|
+
# the daily automation is worth the trade-off, and always scope it to this
|
|
37
|
+
# single repository with the minimum required permissions.
|
|
38
|
+
#
|
|
39
|
+
# To create a Fine-grained PAT (still discouraged unless you need automation):
|
|
30
40
|
# 1. Go to GitHub Settings > Developer settings > Personal access tokens > Fine-grained tokens
|
|
31
41
|
# 2. Click "Generate new token"
|
|
32
42
|
# 3. Give it a descriptive name (e.g., "MegaLinter Auto-Release")
|
|
@@ -62,6 +72,7 @@ jobs:
|
|
|
62
72
|
uses: actions/checkout@v6
|
|
63
73
|
with:
|
|
64
74
|
fetch-depth: 0
|
|
75
|
+
persist-credentials: false
|
|
65
76
|
|
|
66
77
|
- name: Fetch MegaLinter Repository Tags
|
|
67
78
|
id: fetch-megalinter-tags
|
|
@@ -109,12 +120,12 @@ jobs:
|
|
|
109
120
|
|
|
110
121
|
- name: Find New Version
|
|
111
122
|
id: find-new-version
|
|
123
|
+
env:
|
|
124
|
+
LATEST_MEGALINTER_TAG: ${{ steps.fetch-megalinter-tags.outputs.latest_tag }}
|
|
125
|
+
LATEST_REPO_TAG: ${{ steps.fetch-repo-tags.outputs.latest_repo_tag }}
|
|
112
126
|
run: |
|
|
113
127
|
echo "Comparing versions..."
|
|
114
128
|
|
|
115
|
-
LATEST_MEGALINTER_TAG="${{ steps.fetch-megalinter-tags.outputs.latest_tag }}"
|
|
116
|
-
LATEST_REPO_TAG="${{ steps.fetch-repo-tags.outputs.latest_repo_tag }}"
|
|
117
|
-
|
|
118
129
|
echo "Latest MegaLinter tag: $LATEST_MEGALINTER_TAG"
|
|
119
130
|
echo "Latest repository tag: $LATEST_REPO_TAG"
|
|
120
131
|
|
|
@@ -170,11 +181,10 @@ jobs:
|
|
|
170
181
|
# Use PAT_TOKEN if available, otherwise fall back to GITHUB_TOKEN
|
|
171
182
|
# Note: GITHUB_TOKEN doesn't have permission to trigger workflows
|
|
172
183
|
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
|
|
184
|
+
NEW_VERSION: ${{ steps.find-new-version.outputs.new_version }}
|
|
173
185
|
run: |
|
|
174
186
|
echo "Triggering megalinter-custom-flavor-builder workflow..."
|
|
175
187
|
|
|
176
|
-
NEW_VERSION="${{ steps.find-new-version.outputs.new_version }}"
|
|
177
|
-
|
|
178
188
|
# Trigger the workflow using GitHub CLI and capture output
|
|
179
189
|
set +e # Don't exit immediately on error
|
|
180
190
|
gh workflow run megalinter-custom-flavor-builder.yml \
|
|
@@ -212,12 +222,12 @@ jobs:
|
|
|
212
222
|
echo "::error::2. Token name: 'MegaLinter Auto-Release'"
|
|
213
223
|
echo "::error::3. Expiration: Choose 90 days or 1 year"
|
|
214
224
|
echo "::error::4. Repository access: Select 'Only select repositories'"
|
|
215
|
-
echo "::error::5. Choose repository: ${
|
|
225
|
+
echo "::error::5. Choose repository: ${GITHUB_REPOSITORY}"
|
|
216
226
|
echo "::error::6. Repository permissions:"
|
|
217
227
|
echo "::error:: - Contents: Read and write"
|
|
218
228
|
echo "::error:: - Actions: Read and write"
|
|
219
229
|
echo "::error::7. Click 'Generate token' and copy it"
|
|
220
|
-
echo "::error::8. Go to: https://github.com/${
|
|
230
|
+
echo "::error::8. Go to: https://github.com/${GITHUB_REPOSITORY}/settings/secrets/actions"
|
|
221
231
|
echo "::error::9. Click 'New repository secret'"
|
|
222
232
|
echo "::error::10. Name: 'PAT_TOKEN', Value: paste your token"
|
|
223
233
|
echo "::error::"
|
|
@@ -231,43 +241,22 @@ jobs:
|
|
|
231
241
|
|
|
232
242
|
- name: Summary
|
|
233
243
|
if: always()
|
|
244
|
+
env:
|
|
245
|
+
LATEST_MEGALINTER_TAG: ${{ steps.fetch-megalinter-tags.outputs.latest_tag }}
|
|
246
|
+
LATEST_REPO_TAG: ${{ steps.fetch-repo-tags.outputs.latest_repo_tag }}
|
|
247
|
+
NEW_VERSION_FOUND: ${{ steps.find-new-version.outputs.new_version_found }}
|
|
248
|
+
NEW_VERSION: ${{ steps.find-new-version.outputs.new_version }}
|
|
249
|
+
GH_REPO: ${GITHUB_REPOSITORY}
|
|
234
250
|
run: |
|
|
235
251
|
echo "## Check for New MegaLinter Version Summary" >> $GITHUB_STEP_SUMMARY
|
|
236
252
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
237
253
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
if [ "${{ steps.find-new-version.outputs.new_version_found }}" == "true" ]; then
|
|
242
|
-
echo "✅ New version found: **${{ steps.find-new-version.outputs.new_version }}**" >> $GITHUB_STEP_SUMMARY
|
|
254
|
+
if [ "${NEW_VERSION_FOUND}" == "true" ]; then
|
|
255
|
+
echo "New version found: **${NEW_VERSION}**" >> $GITHUB_STEP_SUMMARY
|
|
243
256
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
244
257
|
echo "A new release has been created, which will trigger the custom flavor builder workflow." >> $GITHUB_STEP_SUMMARY
|
|
245
|
-
|
|
246
|
-
# Check if PAT_TOKEN is configured
|
|
247
|
-
if [ -z "${{ secrets.PAT_TOKEN }}" ]; then
|
|
248
|
-
echo "" >> $GITHUB_STEP_SUMMARY
|
|
249
|
-
echo "### ⚠️ REQUIRED: Configure PAT_TOKEN" >> $GITHUB_STEP_SUMMARY
|
|
250
|
-
echo "" >> $GITHUB_STEP_SUMMARY
|
|
251
|
-
echo "**PAT_TOKEN is required to trigger the builder workflow and create releases.**" >> $GITHUB_STEP_SUMMARY
|
|
252
|
-
echo "" >> $GITHUB_STEP_SUMMARY
|
|
253
|
-
echo "Without it, releases will be automatically deleted and the workflow will fail." >> $GITHUB_STEP_SUMMARY
|
|
254
|
-
echo "" >> $GITHUB_STEP_SUMMARY
|
|
255
|
-
echo "**To create a Fine-grained Personal Access Token (recommended - more secure):**" >> $GITHUB_STEP_SUMMARY
|
|
256
|
-
echo "1. Go to [GitHub Settings > Personal access tokens > Fine-grained tokens](https://github.com/settings/personal-access-tokens/new)" >> $GITHUB_STEP_SUMMARY
|
|
257
|
-
echo "2. Token name: \`MegaLinter Auto-Release\`" >> $GITHUB_STEP_SUMMARY
|
|
258
|
-
echo "3. Expiration: Choose 90 days or 1 year" >> $GITHUB_STEP_SUMMARY
|
|
259
|
-
echo "4. Repository access: **Only select repositories**" >> $GITHUB_STEP_SUMMARY
|
|
260
|
-
echo "5. Choose repository: \`${{ github.repository }}\`" >> $GITHUB_STEP_SUMMARY
|
|
261
|
-
echo "6. Repository permissions:" >> $GITHUB_STEP_SUMMARY
|
|
262
|
-
echo " - **Contents**: Read and write" >> $GITHUB_STEP_SUMMARY
|
|
263
|
-
echo " - **Actions**: Read and write" >> $GITHUB_STEP_SUMMARY
|
|
264
|
-
echo "7. Click **Generate token** and copy it" >> $GITHUB_STEP_SUMMARY
|
|
265
|
-
echo "8. Go to [Repository Settings > Secrets](https://github.com/${{ github.repository }}/settings/secrets/actions)" >> $GITHUB_STEP_SUMMARY
|
|
266
|
-
echo "9. Click **New repository secret**" >> $GITHUB_STEP_SUMMARY
|
|
267
|
-
echo "10. Name: \`PAT_TOKEN\`, Value: paste your token" >> $GITHUB_STEP_SUMMARY
|
|
268
|
-
fi
|
|
269
258
|
else
|
|
270
|
-
echo "
|
|
259
|
+
echo "No new versions found. Repository is up to date with MegaLinter." >> $GITHUB_STEP_SUMMARY
|
|
271
260
|
fi
|
|
272
261
|
|
|
273
262
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
@@ -45,6 +45,8 @@ concurrency:
|
|
|
45
45
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
46
46
|
cancel-in-progress: true
|
|
47
47
|
|
|
48
|
+
permissions: {}
|
|
49
|
+
|
|
48
50
|
jobs:
|
|
49
51
|
build-custom-flavor:
|
|
50
52
|
name: Build Custom MegaLinter Flavor
|
|
@@ -61,12 +63,17 @@ jobs:
|
|
|
61
63
|
|
|
62
64
|
- name: Determine MegaLinter Version Tag
|
|
63
65
|
id: determine-tag
|
|
66
|
+
env:
|
|
67
|
+
INPUT_MEGALINTER_VERSION: ${{ inputs.megalinter-version }}
|
|
68
|
+
INPUT_IS_LATEST: ${{ inputs.is-latest }}
|
|
69
|
+
EVENT_NAME: ${{ github.event_name }}
|
|
70
|
+
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
|
64
71
|
run: |
|
|
65
|
-
if [ -n "${
|
|
66
|
-
TAG="${
|
|
72
|
+
if [ -n "${INPUT_MEGALINTER_VERSION}" ]; then
|
|
73
|
+
TAG="${INPUT_MEGALINTER_VERSION}"
|
|
67
74
|
echo "Using workflow input version: $TAG"
|
|
68
|
-
elif [ "${
|
|
69
|
-
TAG="${
|
|
75
|
+
elif [ "${EVENT_NAME}" == "release" ]; then
|
|
76
|
+
TAG="${RELEASE_TAG}"
|
|
70
77
|
echo "Using release tag: $TAG"
|
|
71
78
|
else
|
|
72
79
|
TAG="beta"
|
|
@@ -75,10 +82,10 @@ jobs:
|
|
|
75
82
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
|
76
83
|
|
|
77
84
|
# Determine is-latest flag
|
|
78
|
-
if [ "${
|
|
79
|
-
IS_LATEST="${
|
|
85
|
+
if [ "${EVENT_NAME}" == "workflow_dispatch" ]; then
|
|
86
|
+
IS_LATEST="${INPUT_IS_LATEST}"
|
|
80
87
|
echo "Using workflow input is-latest: $IS_LATEST"
|
|
81
|
-
elif [ "${
|
|
88
|
+
elif [ "${EVENT_NAME}" == "release" ]; then
|
|
82
89
|
IS_LATEST="true"
|
|
83
90
|
echo "Release event - is-latest: true"
|
|
84
91
|
else
|
|
@@ -103,6 +110,10 @@ jobs:
|
|
|
103
110
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
104
111
|
continue-on-error: true
|
|
105
112
|
|
|
113
|
+
- name: Set Lowercase Repository Name
|
|
114
|
+
id: lowercase-repo
|
|
115
|
+
run: echo "repo=$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
|
|
116
|
+
|
|
106
117
|
- name: Build MegaLinter Custom Flavor
|
|
107
118
|
uses: oxsecurity/megalinter/flavors/custom-builder@main
|
|
108
119
|
with:
|
|
@@ -114,6 +125,6 @@ jobs:
|
|
|
114
125
|
dockerhub-repo: ${{ vars.DOCKERHUB_REPO }}
|
|
115
126
|
env:
|
|
116
127
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
117
|
-
CUSTOM_FLAVOR_BUILD_REPO: ${{
|
|
128
|
+
CUSTOM_FLAVOR_BUILD_REPO: ${{ steps.lowercase-repo.outputs.repo }}
|
|
118
129
|
CUSTOM_FLAVOR_BUILD_REPO_URL: ${{ github.repositoryUrl }}
|
|
119
130
|
CUSTOM_FLAVOR_BUILD_USER: ${{ github.actor }}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const ENV_KEY_VALUE_RE = /^[A-Za-z_][A-Za-z0-9_]*=/;
|
|
2
|
+
|
|
3
|
+
// Expand a list of -e values, splitting the legacy comma-separated KEY=VAL,KEY=VAL form
|
|
4
|
+
// into multiple entries while preserving values that simply contain a comma
|
|
5
|
+
// (e.g. ENABLE_LINTERS=YAML_PRETTIER,YAML_YAMLLINT).
|
|
6
|
+
//
|
|
7
|
+
// Heuristic: split on `,` only when every comma-separated part looks like KEY=...
|
|
8
|
+
// Otherwise the comma belongs to the value of a single env var.
|
|
9
|
+
export function expandEnvEntries(envList) {
|
|
10
|
+
if (!Array.isArray(envList)) {
|
|
11
|
+
return envList;
|
|
12
|
+
}
|
|
13
|
+
const result = [];
|
|
14
|
+
for (const entry of envList) {
|
|
15
|
+
if (typeof entry !== "string" || !entry.includes(",")) {
|
|
16
|
+
result.push(entry);
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
const parts = entry.split(",");
|
|
20
|
+
const allLookLikeKv = parts.every((p) => ENV_KEY_VALUE_RE.test(p));
|
|
21
|
+
if (allLookLikeKv && parts.length > 1) {
|
|
22
|
+
result.push(...parts);
|
|
23
|
+
} else {
|
|
24
|
+
result.push(entry);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
}
|