From eda8a3db6818e647b7e06df53182f351c1e92d5b Mon Sep 17 00:00:00 2001 From: YTFL <119737921+YTFL@users.noreply.github.com> Date: Mon, 20 Jul 2026 23:28:09 +0530 Subject: [PATCH 1/4] Update MegaLinter workflow and version Updated MegaLinter configuration to use version 8 and modified permissions and steps for better functionality. --- .github/workflows/mega-linter.yml | 61 ++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 21 deletions(-) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index ce89052..fe2d078 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -1,44 +1,63 @@ ---- name: MegaLinter -# Trigger only on pull requests on: pull_request: - branches: [main, master] + branches: + - main + - master -# Permissions required to comment on PRs and push fixes permissions: - contents: write + contents: read + pull-requests: write + checks: write statuses: write - pull_requests: write jobs: megalinter: name: MegaLinter runs-on: ubuntu-latest + steps: - # Git Checkout - - name: Checkout Code + - name: Checkout repository uses: actions/checkout@v4 with: - token: ${{ secrets.GITHUB_TOKEN }} fetch-depth: 0 - # MegaLinter Execution with auto-fixes enabled - name: Run MegaLinter - uses: oxsecurity/megalinter@v7 + id: megalinter + uses: oxsecurity/megalinter@v8 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # Only lint changed files VALIDATE_ALL_CODEBASE: false - APPLY_FIXES: all - APPLY_FIXES_EVENT: all - # Push automated fixes back to your PR branch - - name: Commit Automated Fixes - if: success() || failure() - uses: stefanzweifel/git-auto-commit-action@v5 + # Apply automatic fixes + APPLY_FIXES: all + APPLY_FIXES_EVENT: pull_request + + # Nice GitHub output + ENABLE_GITHUB_ACTIONS_GROUP_TITLE: true + + # Reports + REPORT_OUTPUT_FOLDER: megalinter-reports + + SHOW_ELAPSED_TIME: true + PRINT_ALL_FILES: false + + # Upload reports + - name: Upload MegaLinter reports + if: always() + uses: actions/upload-artifact@v4 + with: + name: megalinter-reports + path: megalinter-reports/ + + # Upload the auto-fixed files + - name: Upload fixed sources + if: always() + uses: actions/upload-artifact@v4 with: - branch: ${{ github.head_ref || github.ref_name }} - commit_message: "chore: automated code formatting fixes by MegaLinter" - commit_user_name: megalinter-bot - commit_user_email: megalinter-bot@ox.security + name: megalinter-fixed-files + path: . + retention-days: 7 From 40a3a1e9a77ab6f4ea4dd82424975d151efc6396 Mon Sep 17 00:00:00 2001 From: YTFL <119737921+YTFL@users.noreply.github.com> Date: Mon, 20 Jul 2026 23:30:06 +0530 Subject: [PATCH 2/4] Modify .mega-linter.yml settings Updated MegaLinter configuration to enable validation and apply fixes. --- .mega-linter.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.mega-linter.yml b/.mega-linter.yml index a6ce32d..9270958 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -1,13 +1,14 @@ ---- -# Disable heavy/historical linters +VALIDATE_ALL_CODEBASE: false + +APPLY_FIXES: all + +SHOW_ELAPSED_TIME: true + +PRINT_ALL_FILES: false + +REPORT_OUTPUT_FOLDER: megalinter-reports + +# Optional DISABLE: - SPELL - COPYPASTE - - REPOSITORY_GITLEAKS - - REPOSITORY_CHECKOV - - REPOSITORY_KICS - - REPOSITORY_GRYPE - -# Only use the GitHub PR Comment reporter, disable local file generation -REPORTERS: - - github_comment_reporter From df62377787f14d0852b1a2008014d0acb5651ccb Mon Sep 17 00:00:00 2001 From: YTFL <119737921+YTFL@users.noreply.github.com> Date: Mon, 20 Jul 2026 23:35:33 +0530 Subject: [PATCH 3/4] Update mega-linter.yml --- .github/workflows/mega-linter.yml | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index fe2d078..552ef01 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -14,50 +14,31 @@ permissions: jobs: megalinter: - name: MegaLinter runs-on: ubuntu-latest steps: - - name: Checkout repository + - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Run MegaLinter - id: megalinter + - name: MegaLinter + id: ml uses: oxsecurity/megalinter@v8 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # Only lint changed files VALIDATE_ALL_CODEBASE: false - # Apply automatic fixes APPLY_FIXES: all APPLY_FIXES_EVENT: pull_request - # Nice GitHub output - ENABLE_GITHUB_ACTIONS_GROUP_TITLE: true - - # Reports - REPORT_OUTPUT_FOLDER: megalinter-reports - SHOW_ELAPSED_TIME: true PRINT_ALL_FILES: false - # Upload reports - - name: Upload MegaLinter reports + - name: Upload reports if: always() uses: actions/upload-artifact@v4 with: name: megalinter-reports path: megalinter-reports/ - - # Upload the auto-fixed files - - name: Upload fixed sources - if: always() - uses: actions/upload-artifact@v4 - with: - name: megalinter-fixed-files - path: . - retention-days: 7 From 7388ce951b07e606f30965fcc65c1d46a8609737 Mon Sep 17 00:00:00 2001 From: YTFL <119737921+YTFL@users.noreply.github.com> Date: Mon, 20 Jul 2026 23:35:53 +0530 Subject: [PATCH 4/4] Update .mega-linter.yml --- .mega-linter.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.mega-linter.yml b/.mega-linter.yml index 9270958..ed8e459 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -2,13 +2,14 @@ VALIDATE_ALL_CODEBASE: false APPLY_FIXES: all +APPLY_FIXES_EVENT: pull_request + SHOW_ELAPSED_TIME: true PRINT_ALL_FILES: false -REPORT_OUTPUT_FOLDER: megalinter-reports - -# Optional DISABLE: - SPELL - COPYPASTE + +REPORT_OUTPUT_FOLDER: megalinter-reports