-
Notifications
You must be signed in to change notification settings - Fork 20
45 lines (40 loc) · 1.31 KB
/
build_validation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
name: Build Validation
on: # yamllint disable-line rule:truthy
pull_request:
branches:
- main
- "feature/**"
workflow_dispatch:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Filter changes
uses: dorny/paths-filter@v2
id: filter
with:
filters: |
main:
- 'infra/**'
main_json:
- 'infra/arm_output/main.json'
- name: "Stale ARM Template"
if: ${{ steps.filter.outputs.main == 'true' &&
steps.filter.outputs.main_json == 'false' }}
run: echo "::error::Stale ARM Template, please regenerate." && exit 1
# MegaLinter
- name: Lint code base
id: megalinter
uses: oxsecurity/megalinter@v7
env:
# All available variables are described in documentation
# https://megalinter.io/configuration/
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Validates all source when push on main, else just the git diff with main. Override with true if you always want to lint all sources
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}