From cf19a81ab7cd2316bafdcc62c490c14e952600a9 Mon Sep 17 00:00:00 2001 From: Ragdata Date: Mon, 8 Jul 2024 02:16:43 +1000 Subject: [PATCH] [fix]: change token handling --- .github/workflows/call-local.mega-linter.yml | 2 ++ .github/workflows/mega-linter.yml | 13 ++++++++----- .mega-linter.yml | 2 -- callers/call.mega-linter.yml | 4 ++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/call-local.mega-linter.yml b/.github/workflows/call-local.mega-linter.yml index c4f764c..89d8fcf 100644 --- a/.github/workflows/call-local.mega-linter.yml +++ b/.github/workflows/call-local.mega-linter.yml @@ -30,3 +30,5 @@ jobs: issues: write pull-requests: write uses: ./.github/workflows/mega-linter.yml + secrets: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/mega-linter.yml b/.github/workflows/mega-linter.yml index a64ed54..df3d339 100644 --- a/.github/workflows/mega-linter.yml +++ b/.github/workflows/mega-linter.yml @@ -50,6 +50,9 @@ on: required: false type: string default: "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" + secrets: + token: + required: true # Comment env block if you do not want to apply fixes env: @@ -89,7 +92,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.token }} # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to # improve performance # fetch-depth: 0 @@ -151,7 +154,7 @@ jobs: contains(fromJSON('["refs/heads/main", "refs/heads/master"]'), github.ref) }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.token }} # ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE # .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY @@ -197,9 +200,9 @@ jobs: id: cpr if: env.APPLY_FIXES_IF_PR == 'true' with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: "[MegaLinter] Apply linters automatic fixes" - title: "[MegaLinter] Apply linters automatic fixes" + token: ${{ secrets.token }} + commit-message: ${{ inputs.commit_message }} + title: "[MegaLinter] Apply Linters Automatic Fixes" labels: bot ######################################################## diff --git a/.mega-linter.yml b/.mega-linter.yml index 071998a..8a29aba 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -30,8 +30,6 @@ ENABLE_LINTERS: - TYPESCRIPT_STANDARD - XML_XMLLINT - YAML_YAMLLINT -DISABLE_ERRORS_LINTERS: - - # DISABLE: If you use DISABLE variable, the linters in the listed descriptors will be skipped # DISABLE_LINTERS: # If you use DISABLE_LINTERS variable, the listed linters will be skipped PRINT_ALL_FILES: false diff --git a/callers/call.mega-linter.yml b/callers/call.mega-linter.yml index 4dfd320..b489ecd 100644 --- a/callers/call.mega-linter.yml +++ b/callers/call.mega-linter.yml @@ -30,5 +30,5 @@ jobs: issues: write pull-requests: write uses: ragdata/reusable-workflows/.github/workflows/mega-linter.yml@master - with: - megalinter_config: https://raw.githubusercontent.com/Ragdata/reusable-workflows/blob/master/.mega-linter.yml + secrets: + token: ${{ secrets.GITHUB_TOKEN }}