Skip to content

Commit b538aa5

Browse files
committed
test mega inter
1 parent e7b44c6 commit b538aa5

7 files changed

Lines changed: 246 additions & 1 deletion

File tree

.cspell.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"ignorePaths": [
3+
"**/node_modules/**",
4+
"**/vscode-extension/**",
5+
"**/.git/**",
6+
"**/.pnpm-lock.json",
7+
".vscode",
8+
"megalinter",
9+
"package-lock.json",
10+
"report"
11+
],
12+
"language": "en",
13+
"noConfigSearch": true,
14+
"words": ["megalinter", "oxsecurity"],
15+
"version": "0.2"
16+
}

.github/workflows/mega-linter.yml

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
# MegaLinter GitHub Action configuration file
2+
# More info at https://megalinter.io
3+
---
4+
name: MegaLinter
5+
6+
# Trigger mega-linter at every push. Action will also be visible from
7+
# Pull Requests to main
8+
on:
9+
# Comment this line to trigger action only on pull-requests
10+
# (not recommended if you don't pay for GH Actions)
11+
push:
12+
13+
pull_request:
14+
branches:
15+
- main
16+
- master
17+
18+
# Comment env block if you do not want to apply fixes
19+
env:
20+
# Apply linter fixes configuration
21+
#
22+
# When active, APPLY_FIXES must also be defined as environment variable
23+
# (in github/workflows/mega-linter.yml or other CI tool)
24+
APPLY_FIXES: all
25+
26+
# Decide which event triggers application of fixes in a commit or a PR
27+
# (pull_request, push, all)
28+
APPLY_FIXES_EVENT: pull_request
29+
30+
# If APPLY_FIXES is used, defines if the fixes are directly committed (commit)
31+
# or posted in a PR (pull_request)
32+
APPLY_FIXES_MODE: commit
33+
34+
concurrency:
35+
group: ${{ github.ref }}-${{ github.workflow }}
36+
cancel-in-progress: true
37+
38+
jobs:
39+
megalinter:
40+
name: MegaLinter
41+
runs-on: ubuntu-latest
42+
43+
# Give the default GITHUB_TOKEN write permission to commit and push, comment
44+
# issues, and post new Pull Requests; remove the ones you do not need
45+
permissions:
46+
contents: write
47+
issues: write
48+
pull-requests: write
49+
50+
steps:
51+
# Git Checkout
52+
- name: Checkout Code
53+
uses: actions/checkout@v3
54+
with:
55+
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
56+
57+
# If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to
58+
# improve performance
59+
fetch-depth: 0
60+
61+
# MegaLinter
62+
- name: MegaLinter
63+
64+
# You can override MegaLinter flavor used to have faster performances
65+
# More info at https://megalinter.io/latest/flavors/
66+
uses: oxsecurity/megalinter/flavors/java@v7
67+
68+
id: ml
69+
70+
# All available variables are described in documentation
71+
# https://megalinter.io/latest/config-file/
72+
env:
73+
# Validates all source when push on main, else just the git diff with
74+
# main. Override with true if you always want to lint all sources
75+
#
76+
# To validate the entire codebase, set to:
77+
# VALIDATE_ALL_CODEBASE: true
78+
#
79+
# To validate only diff with main, set to:
80+
# VALIDATE_ALL_CODEBASE: >-
81+
# ${{
82+
# github.event_name == 'push' &&
83+
# github.ref == 'refs/heads/main'
84+
# }}
85+
VALIDATE_ALL_CODEBASE: true
86+
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
89+
# ADD YOUR CUSTOM ENV VARIABLES HERE TO OVERRIDE VALUES OF
90+
# .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY
91+
92+
# Upload MegaLinter artifacts
93+
- name: Archive production artifacts
94+
uses: actions/upload-artifact@v3
95+
if: success() || failure()
96+
with:
97+
name: MegaLinter reports
98+
path: |
99+
megalinter-reports
100+
mega-linter.log
101+
102+
# Create pull request if applicable
103+
# (for now works only on PR from same repository, not from forks)
104+
- name: Create Pull Request with applied fixes
105+
uses: peter-evans/create-pull-request@v5
106+
id: cpr
107+
if: >-
108+
steps.ml.outputs.has_updated_sources == 1 &&
109+
(
110+
env.APPLY_FIXES_EVENT == 'all' ||
111+
env.APPLY_FIXES_EVENT == github.event_name
112+
) &&
113+
env.APPLY_FIXES_MODE == 'pull_request' &&
114+
(
115+
github.event_name == 'push' ||
116+
github.event.pull_request.head.repo.full_name == github.repository
117+
) &&
118+
!contains(github.event.head_commit.message, 'skip fix')
119+
with:
120+
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
121+
commit-message: "[MegaLinter] Apply linters automatic fixes"
122+
title: "[MegaLinter] Apply linters automatic fixes"
123+
labels: bot
124+
125+
- name: Create PR output
126+
if: >-
127+
steps.ml.outputs.has_updated_sources == 1 &&
128+
(
129+
env.APPLY_FIXES_EVENT == 'all' ||
130+
env.APPLY_FIXES_EVENT == github.event_name
131+
) &&
132+
env.APPLY_FIXES_MODE == 'pull_request' &&
133+
(
134+
github.event_name == 'push' ||
135+
github.event.pull_request.head.repo.full_name == github.repository
136+
) &&
137+
!contains(github.event.head_commit.message, 'skip fix')
138+
run: |
139+
echo "PR Number - ${{ steps.cpr.outputs.pull-request-number }}"
140+
echo "PR URL - ${{ steps.cpr.outputs.pull-request-url }}"
141+
142+
# Push new commit if applicable
143+
# (for now works only on PR from same repository, not from forks)
144+
- name: Prepare commit
145+
if: >-
146+
steps.ml.outputs.has_updated_sources == 1 &&
147+
(
148+
env.APPLY_FIXES_EVENT == 'all' ||
149+
env.APPLY_FIXES_EVENT == github.event_name
150+
) &&
151+
env.APPLY_FIXES_MODE == 'commit' &&
152+
github.ref != 'refs/heads/main' &&
153+
(
154+
github.event_name == 'push' ||
155+
github.event.pull_request.head.repo.full_name == github.repository
156+
) &&
157+
!contains(github.event.head_commit.message, 'skip fix')
158+
run: sudo chown -Rc $UID .git/
159+
160+
- name: Commit and push applied linter fixes
161+
uses: stefanzweifel/git-auto-commit-action@v4
162+
if: >-
163+
steps.ml.outputs.has_updated_sources == 1 &&
164+
(
165+
env.APPLY_FIXES_EVENT == 'all' ||
166+
env.APPLY_FIXES_EVENT == github.event_name
167+
) &&
168+
env.APPLY_FIXES_MODE == 'commit' &&
169+
github.ref != 'refs/heads/main' &&
170+
(
171+
github.event_name == 'push' ||
172+
github.event.pull_request.head.repo.full_name == github.repository
173+
) &&
174+
!contains(github.event.head_commit.message, 'skip fix')
175+
with:
176+
branch: >-
177+
${{
178+
github.event.pull_request.head.ref ||
179+
github.head_ref ||
180+
github.ref
181+
}}
182+
commit_message: "[MegaLinter] Apply linters fixes"
183+
commit_user_name: megalinter-bot
184+
commit_user_email: nicolas.vuillamy@ox.security

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ bin/
3636
.vscode/
3737

3838
### Mac OS ###
39-
.DS_Store
39+
.DS_Store
40+
megalinter-reports/

.jscpd.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"threshold": 0,
3+
"reporters": ["html", "markdown"],
4+
"ignore": [
5+
"**/node_modules/**",
6+
"**/.git/**",
7+
"**/.rbenv/**",
8+
"**/.venv/**",
9+
"**/*cache*/**",
10+
"**/.github/**",
11+
"**/.idea/**",
12+
"**/report/**",
13+
"**/*.svg"
14+
]
15+
}

.mega-linter.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Configuration file for MegaLinter
2+
#
3+
# See all available variables at https://megalinter.io/latest/config-file/ and in
4+
# linters documentation
5+
6+
# all, none, or list of linter keys
7+
APPLY_FIXES: all
8+
9+
# If you use ENABLE variable, all other languages/formats/tooling-formats will
10+
# be disabled by default
11+
# ENABLE:
12+
13+
# If you use ENABLE_LINTERS variable, all other linters will be disabled by
14+
# default
15+
# ENABLE_LINTERS:
16+
17+
DISABLE:
18+
- COPYPASTE # Comment to enable checks of excessive copy-pastes
19+
# - SPELL # Uncomment to disable checks of spelling mistakes
20+
21+
SHOW_ELAPSED_TIME: true
22+
23+
FILEIO_REPORTER: false
24+
25+
# Uncomment if you want MegaLinter to detect errors but not block CI to pass
26+
# DISABLE_ERRORS: true

app/.groovylintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "all"
3+
}

logback.log

Whitespace-only changes.

0 commit comments

Comments
 (0)