-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
372 additions
and
17 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: Code Quality IDE configuration | ||
# Opens PR with automatic IDE configuration from MegaLinter | ||
|
||
on: | ||
workflow_call: | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
APPLY_FIXES: none | ||
|
||
jobs: | ||
create-code-quality-ide-configuration: | ||
name: Run MegaLinter to create IDE configuration | ||
runs-on: ubuntu-latest | ||
|
||
# Give the default GITHUB_TOKEN write permission to commit and push, comment | ||
# issues & post new PR; remove the ones you do not need | ||
permissions: | ||
actions: read # Needed to run codeql/upload-sarif@v3 | ||
contents: write | ||
issues: write | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Load configuration | ||
uses: actions/checkout@v4 | ||
with: | ||
path: /config | ||
|
||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} | ||
|
||
# If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to | ||
# improve performance | ||
fetch-depth: 0 | ||
|
||
# MegaLinter | ||
- name: MegaLinter | ||
# You can override MegaLinter flavor used to have faster performances | ||
# More info at https://megalinter.io/flavors/ | ||
uses: oxsecurity/megalinter@v7 | ||
|
||
# All available variables are described in documentation | ||
# https://megalinter.io/configuration/ | ||
env: | ||
# Define the reporters used in this action (not overrideable) | ||
CONFIG_REPORTER: true | ||
# Disable all other reporters | ||
TEXT_REPORTER: false | ||
GITHUB_COMMENT_REPORTER: false | ||
GITLAB_COMMENT_REPORTER: false | ||
AZURE_COMMENT_REPORTER: false | ||
BITBUCKET_COMMENT_REPORTER: false | ||
GITHUB_STATUS_REPORTER: false | ||
SARIF_REPORTER: false | ||
UPDATED_SOURCES_REPORTER: false | ||
EMAIL_REPORTER: false | ||
FILEIO_REPORTER: false | ||
TAP_REPORTER: false | ||
CONSOLE_REPORTER: false | ||
JSON_REPORTER: false | ||
MARKDOWN_SUMMARY_REPORTER: false | ||
|
||
|
||
# Extend the configuration file if it exists, else use default | ||
EXTENDS: ${{ hashFiles('.mega-linter.yml') != '' && '/config/.mega-linter.yml' || '' }} | ||
MEGALINTER_CONFIG_FILE: ${{ hashFiles('.mega-linter.yml') = '' && '/config/.mega-linter.yml' || '' }} | ||
|
||
VALIDATE_ALL_CODEBASE: false | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Prepare output | ||
run: | | ||
mv IDE-config/* . | ||
# Create pull request if applicable | ||
# (for now works only on PR from same repository, not from forks) | ||
- name: Create Pull Request with applied fixes | ||
uses: peter-evans/create-pull-request@v6 | ||
id: cpr | ||
with: | ||
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} | ||
commit-message: "[BiosustainMegaLinter] Apply linters automatic fixes" | ||
title: "[BiosustainMegaLinter] Apply linters automatic fixes" | ||
labels: bot | ||
|
||
- name: Create PR output | ||
if: env.APPLY_FIXES_IF_PR == 'true' | ||
run: | | ||
echo "PR Number - ${{ steps.cpr.outputs.pull-request-number }}" | ||
echo "PR URL - ${{ steps.cpr.outputs.pull-request-url }}" |
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
Oops, something went wrong.