-
Notifications
You must be signed in to change notification settings - Fork 70
/
chronicle-rules-cicd.yml
37 lines (30 loc) · 1.18 KB
/
chronicle-rules-cicd.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
name: chronicle-rules-cicd
on:
push:
branches: [ main ]
jobs:
push-rules:
runs-on: ubuntu-latest
env:
region: europe # modify this to us, europe, or asia-southeast1 according to your region
rules_path: backends/chronicle/yaral # modify to the relative path in the root of the repository which contains rules
steps:
- name: Checkout repo content
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
if [ -f scripts/python/requirements.txt ]; then pip install -r scripts/python/requirements.txt; fi
- name: Pre-upload dry run
run: |
python3 scripts/python/rules.py -i "${{ secrets.SA_CREDENTIAL }}" -l $rules_path -s -r $region
- name: Upload/update any rules
run: |
python3 scripts/python/rules.py -i "${{ secrets.SA_CREDENTIAL }}" -l $rules_path -s -r $region -m
- name: Post-upload dry run
run: |
python3 scripts/python/rules.py -i "${{ secrets.SA_CREDENTIAL }}" -l $rules_path -s -r $region