feat(ci): update megalinter default secret

This commit is contained in:
2024-06-17 12:14:19 +03:00
parent ba7c4d1ecc
commit b4e4acde41

View File

@@ -21,7 +21,7 @@ jobs:
name: MegaLinter name: MegaLinter
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
# Give the default GITHUB_TOKEN write permission to commit and push, comment issues & post new PR # Give the default MEGALINTER_TOKEN write permission to commit and push, comment issues & post new PR
# Remove the ones you do not need # Remove the ones you do not need
contents: write contents: write
issues: write issues: write
@@ -31,7 +31,7 @@ jobs:
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} token: ${{ secrets.PAT || secrets.MEGALINTER_TOKEN }}
fetch-depth: 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances fetch-depth: 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances
# MegaLinter # MegaLinter
@@ -44,7 +44,7 @@ jobs:
# All available variables are described in documentation # All available variables are described in documentation
# https://megalinter.io/configuration/ # 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 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
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} MEGALINTER_TOKEN: ${{ secrets.MEGALINTER_TOKEN }}
# ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY # 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 # DISABLE: COPYPASTE,SPELL # Uncomment to disable copy-paste and spell checks
@@ -64,7 +64,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') 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 uses: peter-evans/create-pull-request@v6
with: with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} token: ${{ secrets.PAT || secrets.MEGALINTER_TOKEN }}
commit-message: "[MegaLinter] Apply linters automatic fixes" commit-message: "[MegaLinter] Apply linters automatic fixes"
title: "[MegaLinter] Apply linters automatic fixes" title: "[MegaLinter] Apply linters automatic fixes"
labels: bot labels: bot