build(deps-dev): bump prettier from 3.0.3 to 3.5.0 #316
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
--- | ||
# vim: set ai expandtab sw=2 ts=2 sts=2 re=2 ft=yaml: | ||
# code: language=yaml | ||
# | ||
# SPDX-FileCopyrightText: 2023 Pablo Hörtner <[email protected]> | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
# | ||
# Copyright © 2023 by Pablo Hörtner <[email protected]>. All rights reserved. | ||
# You can find the AGPL v3.0 here: https://www.gnu.org/licenses/agpl-3.0 | ||
# Attribution required if you use this EditorConfig file in your project. | ||
# | ||
# This workflow executes several linters on changed files based on languages | ||
# used in our code base – whenever we "git push" code or open a pull request. | ||
# | ||
# MegaLinter GitHub Action | ||
# @see https://megalinter.io | ||
name: Lint Code Base | ||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
env: | ||
# Apply linter fixes | ||
APPLY_FIXES: all | ||
APPLY_FIXES_EVENT: pull_request | ||
APPLY_FIXES_MODE: commit | ||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
jobs: | ||
build: | ||
name: MegaLinter | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
# Full git history is needed to get a proper | ||
# list of changed files within `super-linter` | ||
fetch-depth: 0 | ||
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} | ||
- name: Lint Code Base | ||
id: ml | ||
# You can override MegaLinter flavor used to have faster performances | ||
# @see https://megalinter.io/flavors/ | ||
uses: oxsecurity/megalinter@v7 | ||
env: | ||
# All available variables are described in the documentation | ||
# @see https://megalinter.io/configuration/ | ||
DEFAULT_BRANCH: "main" # deprecated | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' \ | ||
Check failure on line 63 in .github/workflows/mega-linter.yml
|
||
&& github.ref == 'refs/heads/main' }} | ||
- name: Archive production artifacts | ||
if: ${{ success() }} || ${{ failure() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: MegaLinter reports | ||
path: | | ||
megalinter-reports | ||
mega-linter.log | ||
- name: Create Pull Request with applied fixes | ||
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_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 | ||
with: | ||
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} | ||
commit-message: "[MegaLinter] Apply linters automatic fixes" | ||
title: "[MegaLinter] Apply linters automatic fixes" | ||
labels: bot | ||
- name: Create PR 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_name == 'push' || \ | ||
github.event.pull_request.head.repo.full_name == github.repository) \ | ||
&& !contains(github.event.head_commit.message, 'skip fix') | ||
run: | | ||
echo "Pull Request Number - \ | ||
${{ steps.cpr.outputs.pull-request-number }}" | ||
echo "Pull Request URL - \ | ||
${{ steps.cpr.outputs.pull-request-url }}" | ||
- name: Prepare 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/main' \ | ||
&& (github.event_name == 'push' || \ | ||
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 and push applied linter fixes | ||
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/main' \ | ||
&& (github.event_name == 'push' || \ | ||
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: "fix(linters): apply linter fixes" | ||
commit_user_name: linter-bot | ||
commit_user_email: [email protected] |