44name : MegaLinter
55
66on :
7- # Trigger mega-linter at every push. Action will also be visible from Pull Requests to master
8- push : # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions)
7+ push :
8+ branches :
9+ - main
910 pull_request :
10- branches : [master, main]
11+ branches :
12+ - main
1113
1214env : # Comment env block if you do not want to apply fixes
1315 # Apply linter fixes configuration
2628 steps :
2729 # Git Checkout
2830 - name : Checkout Code
29- uses : actions/checkout@v4
31+ uses : actions/checkout@v6
3032 with :
3133 token : ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
3234 fetch-depth : 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances
@@ -35,19 +37,19 @@ jobs:
3537 - name : MegaLinter
3638 id : ml
3739 # You can override MegaLinter flavor used to have faster performances
38- # More info at https://megalinter.io/flavors/
40+ # More info at https://megalinter.io/latest/ flavors/
3941 uses : oxsecurity/megalinter/flavors/python@beta
4042 env :
4143 # All available variables are described in documentation
42- # https://megalinter.io/config-file/
44+ # https://megalinter.io/latest/ config-file/
4345 VALIDATE_ALL_CODEBASE : true # Set ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} to validate only diff with main branch
4446 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4547 # ADD YOUR CUSTOM ENV VARIABLES HERE TO OVERRIDE VALUES OF .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY
4648
4749 # Upload MegaLinter artifacts
4850 - name : Archive production artifacts
4951 if : success() || failure()
50- uses : actions/upload-artifact@v4
52+ uses : actions/upload-artifact@v6
5153 with :
5254 name : MegaLinter reports
5355 path : |
5860 - name : Create Pull Request with applied fixes
5961 id : cpr
6062 if : steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
61- uses : peter-evans/create-pull-request@v6
63+ uses : peter-evans/create-pull-request@v8
6264 with :
6365 token : ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
6466 commit-message : " [MegaLinter] Apply linters automatic fixes"
7678 run : sudo chown -Rc $UID .git/
7779 - name : Commit and push applied linter fixes
7880 if : steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
79- uses : stefanzweifel/git-auto-commit-action@v5
81+ uses : stefanzweifel/git-auto-commit-action@v7
8082 with :
8183 branch : ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
8284 commit_message : " [MegaLinter] Apply linters fixes"
0 commit comments