Bump lint-staged from 13.2.3 to 14.0.0 #25
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
name: Lint | |
on: | |
pull_request: | |
branches: [develop] | |
permissions: read-all | |
env: | |
APPLY_FIXES: all | |
APPLY_FIXES_EVENT: pull_request | |
APPLY_FIXES_MODE: commit | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} | |
fetch-depth: 0 | |
- name: Lint | |
id: ml | |
uses: oxsecurity/megalinter/flavors/[email protected] | |
env: | |
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Report | |
if: ${{ success() }} || ${{ failure() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Lint Report | |
path: | | |
megalinter-reports | |
mega-linter.log | |
- name: Fix | |
id: cpr | |
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.pull_request.head.repo.full_name == github.repository && !contains(github.event.head_commit.message, 'skip fix') | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} | |
commit-message: "Apply lint fixes" | |
title: "Apply lint fixes" | |
labels: bot | |
- name: Output | |
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.pull_request.head.repo.full_name == github.repository && !contains(github.event.head_commit.message, 'skip fix') | |
run: | | |
echo "PR: ${{ steps.cpr.outputs.pull-request-number }}" | |
echo "PR URL: ${{ steps.cpr.outputs.pull-request-url }}" | |
- name: Prepare | |
if: 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/develop' && github.event.pull_request.head.repo.full_name == github.repository && !contains(github.event.head_commit.message, 'skip fix') | |
run: sudo chown -Rc $UID .git/ | |
- name: Commit | |
if: 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/develop' && github.event.pull_request.head.repo.full_name == github.repository && !contains(github.event.head_commit.message, 'skip fix') | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }} | |
commit_message: "Apply lint fixes" | |
commit_user_name: withinfocus | |
commit_user_email: [email protected] |