Mega-linter is able to apply fixes provided by linters. To use this capability, you need 3 env variables defined at top level
allto apply fixes of all linters, or a list of linter keys (ex:
Only for GitHub Action Workflow file if you use it:
none(use none in case of use of Updated sources reporter)
committo create a new commit and push it on the same branch, or
pull_requestto create a new PR targeting the branch.
Apply fixes issues
You may see github permission errors, or workflows not run on the new commit.
To solve these issues, you can apply one of the following solutions.
- Method 1: The most secured
- Method 2: Easier, but any contributor with write access can see your Personal Access Token
- You can use Updated sources reporter if you don't want fixes to be automatically applied on git branch, but download them in a zipped file and manually extract them in your project
- If used, APPLY_FIXES_EVENT and APPLY_FIXES_MODE can not be defined in
.mega-linter.ymlconfig file, they must be set as environment variables
- If you use APPLY_FIXES, add the following line in your