Merge pull request #351 from nvuillam/patch-1

Update mega-linter.yml to manage permissions & trigger workflows after autocommit
pull/352/head
Romain 2023-05-19 12:50:16 +02:00 committed by GitHub
commit 1b58c02982
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -7,7 +7,7 @@ on:
# Trigger mega-linter at every push. Action will also be visible from Pull Requests to main # Trigger mega-linter at every push. Action will also be visible from Pull Requests to main
#push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions) #push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions)
pull_request: pull_request:
branches: [master, main] branches: [main]
permissions: permissions:
contents: write contents: write
@ -28,13 +28,15 @@ jobs:
build: build:
name: MegaLinter name: MegaLinter
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment:
name: megalinter
continue-on-error: true continue-on-error: true
steps: steps:
# Git Checkout # Git Checkout
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
fetch-depth: 0 fetch-depth: 0
# MegaLinter # MegaLinter
@ -70,7 +72,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@v5 uses: peter-evans/create-pull-request@v5
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.PAT || secrets.GITHUB_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