Skip to content

Commit 656d0f3

Browse files
dev: api reporter and standard config
1 parent 82c60ee commit 656d0f3

File tree

2 files changed

+44
-23
lines changed

2 files changed

+44
-23
lines changed

.github/workflows/changelog-check.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
pull_request:
77
paths-ignore:
88
- "README.md"
9-
- "CHANGELOG.md"
109
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
1110

1211
jobs:
@@ -22,8 +21,13 @@ jobs:
2221
- name: Checkout Code
2322
uses: actions/checkout@v4
2423
with:
25-
token: "${{ secrets.PAT || secrets.GITHUB_TOKEN }}"
26-
- run: echo "🐙 ${{ github.repository }} repository was cloned to the runner."
24+
fetch-depth: 0
25+
sparse-checkout: |
26+
docs
27+
overrides
28+
.github
29+
CHANGELOG.md
30+
- run: echo "🐙 Sparse Checkout of ${{ github.repository }} repository to the CI runner."
2731

2832
# Changelog Enforcer
2933
- name: Changelog Enforcer

.github/workflows/megalinter.yaml

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# MegaLinter GitHub Action configuration file
33
# More info at https://megalinter.io
4-
# All variables described in https://megalinter.io/latest/config-file/
4+
# All variables described in https://megalinter.io/latest/configuration/
55

66
name: MegaLinter
77
on:
@@ -21,16 +21,14 @@ jobs:
2121
megalinter:
2222
name: MegaLinter
2323
runs-on: ubuntu-latest
24-
env:
25-
# Grafana Dashboard Connections - GitHub Organization secrets
26-
API_REPORTER: true
27-
API_REPORTER_URL: ${{ secrets.API_REPORTER_URL }}
28-
API_REPORTER_BASIC_AUTH_USERNAME: ${{ secrets.API_REPORTER_BASIC_AUTH_USERNAME }}
29-
API_REPORTER_BASIC_AUTH_PASSWORD: ${{ secrets.API_REPORTER_BASIC_AUTH_PASSWORD }}
30-
API_REPORTER_METRICS_URL: ${{ secrets.API_REPORTER_METRICS_URL }}
31-
API_REPORTER_METRICS_BASIC_AUTH_USERNAME: ${{ secrets.API_REPORTER_METRICS_BASIC_AUTH_USERNAME }}
32-
API_REPORTER_METRICS_BASIC_AUTH_PASSWORD: ${{ secrets.API_REPORTER_METRICS_BASIC_AUTH_PASSWORD }}
33-
API_REPORTER_DEBUG: true
24+
25+
# Give the default GITHUB_TOKEN write permission to commit and push, comment
26+
# issues, and post new Pull Requests; remove the ones you do not need
27+
permissions:
28+
contents: write
29+
issues: write
30+
pull-requests: write
31+
3432
steps:
3533
- run: echo "🚀 Job automatically triggered by ${{ github.event_name }}"
3634
- run: echo "🐧 Job running on ${{ runner.os }} server"
@@ -40,27 +38,46 @@ jobs:
4038
- name: Checkout Code
4139
uses: actions/checkout@v4
4240
with:
43-
token: "${{ secrets.PAT || secrets.GITHUB_TOKEN }}"
4441
fetch-depth: 0
45-
- run: echo "🐙 ${{ github.repository }} repository was cloned to the runner."
42+
sparse-checkout: |
43+
docs
44+
overrides
45+
.github
46+
- run: echo "🐙 Sparse Checkout of ${{ github.repository }} repository to the CI runner."
4647

4748
# MegaLinter Configuration
4849
- name: MegaLinter Run
49-
id: ml
50-
## latest release of major version
5150
uses: oxsecurity/megalinter/flavors/[email protected]
51+
id: ml
5252
env:
53-
# ADD CUSTOM ENV VARIABLES OR DEFINE IN MEGALINTER_CONFIG file
54-
MEGALINTER_CONFIG: .github/config/megalinter.yaml
5553

56-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" # report individual linter status
57-
# Validate all source when push on main, else just the git diff with live.
54+
# Validate the git diff against default branch.
5855
VALIDATE_ALL_CODEBASE: >-
5956
${{ github.event_name == 'push' && github.ref == 'refs/heads/main'}}
6057
58+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" # report individual linter status
59+
60+
# ADD CUSTOM ENV VARIABLES OR DEFINE IN MEGALINTER_CONFIG file
61+
MEGALINTER_CONFIG: .github/config/megalinter.yaml
62+
63+
# Grafana Dashboard Connections - GitHub Organization secrets
64+
API_REPORTER: true
65+
API_REPORTER_URL: ${{ secrets.API_REPORTER_URL }}
66+
API_REPORTER_BASIC_AUTH_USERNAME: ${{ secrets.API_REPORTER_BASIC_AUTH_USERNAME }}
67+
API_REPORTER_BASIC_AUTH_PASSWORD: ${{ secrets.API_REPORTER_BASIC_AUTH_PASSWORD }}
68+
API_REPORTER_BEARER_TOKEN: ${{ secrets.API_REPORTER_BEARER_PASSWORD }}
69+
API_REPORTER_METRICS_URL: ${{ secrets.API_REPORTER_METRICS_URL }}
70+
API_REPORTER_METRICS_BASIC_AUTH_USERNAME: ${{ secrets.API_REPORTER_METRICS_BASIC_AUTH_USERNAME }}
71+
API_REPORTER_METRICS_BASIC_AUTH_PASSWORD: ${{ secrets.API_REPORTER_METRICS_BASIC_AUTH_PASSWORD }}
72+
API_REPORTER_METRICS_BEARER_TOKEN: ${{ secrets.API_REPORTER_METRICS_BEARER_PASSWORD }}
73+
API_REPORTER_DEBUG: false
74+
75+
# Logging
76+
# LOG_LEVEL: DEBUG
77+
6178
# Upload MegaLinter artifacts
6279
- name: Archive production artifacts
63-
if: ${{ success() }} || ${{ failure() }}
80+
if: success() || failure()
6481
uses: actions/upload-artifact@v4
6582
with:
6683
name: MegaLinter reports

0 commit comments

Comments
 (0)