forked from Azure/Azure-Proactive-Resiliency-Library-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (55 loc) · 1.49 KB
/
validate-queries.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Validate ARG Queries
on:
pull_request_target:
branches:
- main
- dev-tools
types:
- opened
- reopened
- synchronize
- ready_for_review
paths:
- '**/*.kql'
workflow_dispatch: {}
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
kql_file_check:
runs-on: ubuntu-latest
if: |
(
github.event.pull_request.head.repo.full_name == 'Azure/Azure-Proactive-Resiliency-Library-v2'
)
||
(
github.event.pull_request.head.repo.full_name != 'Azure/Azure-Proactive-Resiliency-Library-v2'
&&
contains(github.event.pull_request.labels.*.name, 'PR: Safe to Test ARG Queries :test_tube:')
)
||
(
github.event_name == 'workflow_dispatch'
)
||
(
github.event_name == 'merge_group'
)
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Azure login (OIDC)
uses: azure/login@v2
if:
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
enable-AzPSSession: true
- name: Run KQL Comment Check
run: |
pwsh .github/scripts/validate-kql-comments.ps1
- name: Run KQL Syntax Check
run: |
pwsh .github/scripts/validate-kql-syntax.ps1