From 170230ce9fa6e77c08816eabb647d0f022efd490 Mon Sep 17 00:00:00 2001 From: Mykhailo Nikiforov Date: Mon, 17 Jun 2024 12:19:29 +0300 Subject: [PATCH] feat(ci): add secrets to the megalinter job --- .gitea/workflows/sec-megalinter.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/sec-megalinter.yml b/.gitea/workflows/sec-megalinter.yml index 6cb7b1b..97eb8a0 100644 --- a/.gitea/workflows/sec-megalinter.yml +++ b/.gitea/workflows/sec-megalinter.yml @@ -5,6 +5,13 @@ name: MegaLinter on: workflow_call: + secrets: + gitea-token: + required: true + type: string + github-token: + required: false + type: string env: # Comment env block if you don't want to apply fixes # Apply linter fixes configuration @@ -31,7 +38,7 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 with: - token: ${{ secrets.PAT || secrets.MEGALINTER_TOKEN }} + token: ${{ secrets.github-token || secrets.gitea-token }} fetch-depth: 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances # MegaLinter @@ -44,7 +51,7 @@ jobs: # All available variables are described in documentation # https://megalinter.io/configuration/ VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Validates all source when push on main, else just the git diff with main. Override with true if you always want to lint all sources - MEGALINTER_TOKEN: ${{ secrets.MEGALINTER_TOKEN }} + MEGALINTER_TOKEN: ${{ secrets.gitea-token }} # ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY # DISABLE: COPYPASTE,SPELL # Uncomment to disable copy-paste and spell checks @@ -64,7 +71,7 @@ jobs: 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') uses: peter-evans/create-pull-request@v6 with: - token: ${{ secrets.PAT || secrets.MEGALINTER_TOKEN }} + token: ${{ secrets.github-token || secrets.gitea-token }} commit-message: "[MegaLinter] Apply linters automatic fixes" title: "[MegaLinter] Apply linters automatic fixes" labels: bot