Bump peter-evans/create-pull-request from 6.0.1 to 6.0.2 #551
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MegaLinter GitHub Action configuration file | |
# More info at https://megalinter.io | |
--- | |
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: MegaLinter | |
on: | |
# Trigger mega-linter at every push. Action will also be visible from Pull Requests to master | |
push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions) | |
pull_request: | |
branches: [master, main] | |
env: # Comment env block if you do not want to apply fixes | |
# Apply linter fixes configuration | |
APPLY_FIXES: none # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool) | |
APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all) | |
APPLY_FIXES_MODE: commit # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request) | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
permissions: | |
# Give the default GITHUB_TOKEN write permission to commit and push, comment issues & post new PR | |
# Remove the ones you do not need | |
contents: read | |
issues: write | |
pull-requests: write | |
jobs: | |
megalinter: | |
name: MegaLinter | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
# Git Checkout | |
# kics-scan ignore-line | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
name: Checkout Code | |
with: | |
set-safe-directory: true | |
# token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
fetch-depth: 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances | |
# MegaLinter | |
# You can override MegaLinter flavor used to have faster performances | |
# More info at https://megalinter.io/latest/flavors | |
# kics-scan ignore-line | |
- uses: oxsecurity/megalinter/flavors/terraform@a7a0163b6c8ff7474a283d99a706e27483ddd80f | |
name: MegaLinter | |
id: ml | |
env: | |
# All available variables are described in documentation | |
# https://megalinter.io/latest/config-file/ | |
# Validates all source when push on main or run in act, else just the git diff with main. Set 'true' if you always want to lint all sources | |
VALIDATE_ALL_CODEBASE: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.actor == 'nektos/act' }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# ADD YOUR CUSTOM ENV VARIABLES HERE TO OVERRIDE VALUES OF .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY | |
# Upload MegaLinter artifacts | |
# kics-scan ignore-line | |
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 | |
name: Archive production artifacts | |
if: github.actor != 'nektos/act' && (success() || failure()) | |
with: | |
name: MegaLinter reports | |
path: | | |
megalinter-reports | |
mega-linter.log | |
# Create pull request if applicable (for now works only on PR from same repository, not from forks) | |
- uses: peter-evans/create-pull-request@70a41aba780001da0a30141984ae2a0c95d8704e | |
name: Create Pull Request with applied fixes | |
id: cpr | |
if: >- | |
github.actor != 'nektos/act' && | |
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 | |
) | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: '[MegaLinter] Apply linters automatic fixes' | |
title: '[MegaLinter] Apply linters automatic fixes' | |
labels: bot | |
- name: Create PR output | |
if: >- | |
github.actor != 'nektos/act' && | |
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 | |
) | |
run: | | |
printf "Pull Request Number - %s\n" "${PR_NUMBER}" | |
printf "Pull Request URL - %s\n" "${PR_URL}" | |
env: | |
PR_NUMBER: '${{ steps.cpr.outputs.pull-request-number }}' | |
PR_URL: '${{ steps.cpr.outputs.pull-request-url }}' | |
# Push new commit if applicable (for now works only on PR from same repository, not from forks) | |
- name: Prepare commit | |
if: >- | |
github.actor != 'nektos/act' && | |
steps.ml.outputs.has_updated_sources == 1 && | |
( | |
env.APPLY_FIXES_EVENT == 'all' || | |
env.APPLY_FIXES_EVENT == github.event_name | |
) && | |
env.APPLY_FIXES_MODE == 'commit' && | |
github.ref != 'refs/heads/main' && | |
( | |
github.event_name == 'push' || | |
github.event.pull_request.head.repo.full_name == github.repository | |
) | |
run: 'sudo chown -Rc $UID .git/' | |
# kics-scan ignore-line | |
- uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d | |
name: Commit and push applied linter fixes | |
if: >- | |
github.actor != 'nektos/act' && | |
steps.ml.outputs.has_updated_sources == 1 && | |
( | |
env.APPLY_FIXES_EVENT == 'all' || | |
env.APPLY_FIXES_EVENT == github.event_name | |
) && | |
env.APPLY_FIXES_MODE == 'commit' && | |
github.ref != 'refs/heads/main' && | |
( | |
github.event_name == 'push' || | |
github.event.pull_request.head.repo.full_name == github.repository | |
) | |
with: | |
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }} | |
commit_message: '[MegaLinter] Apply linters fixes' | |
commit_user_name: megalinter-bot | |
commit_user_email: nicolas.vuillamy@ox.security |