Skip to content

Commit a9e6659

Browse files
committed
feat(ci): add MegaLinter GitHub Action for Java projects
Added a GitHub Action workflow to integrate MegaLinter for Java code linting. The action runs on every push to the `main` branch and on pull requests, ensuring code quality through linting and archiving linting reports.
1 parent 1ea2d9b commit a9e6659

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/mega-linter.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
# MegaLinter GitHub Action configuration file
3+
# More info at https://megalinter.io/latest/install-github/
4+
name: MegaLinter
5+
6+
permissions: read-all
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
pull_request:
13+
14+
concurrency:
15+
group: ${{ github.ref }}-${{ github.workflow }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
megalinter:
20+
name: MegaLinter
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
pull-requests: write
25+
steps:
26+
- name: Checkout Code
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Java
30+
uses: actions/setup-java@v3
31+
with:
32+
java-version: 21
33+
distribution: corretto
34+
35+
- name: MegaLinter
36+
uses: oxsecurity/megalinter/flavors/[email protected]
37+
env:
38+
VALIDATE_ALL_CODEBASE: true
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Archive production artifacts
42+
if: success() || failure()
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: MegaLinter reports
46+
path: |
47+
megalinter-reports
48+
mega-linter.log

0 commit comments

Comments
 (0)