-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yaml
64 lines (64 loc) · 2.08 KB
/
action.yaml
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
63
64
name: "Test Action"
description: "test action"
inputs:
api_endpoint:
description: "Boost API endpoint"
required: false
default: https://api.boostsecurity.io
api_token:
description: "Boost API token"
required: true
registry_path:
description: "Registry base path."
required: false
default: "."
docs_url:
description: "URL to the documentation"
required: false
default: "https://docs.boostsecurity.io"
runs:
using: "composite"
steps:
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install poetry
run: pip3 install --pre "poetry==1.4.2"
shell: bash
- name: Install dependencies
run: |
cp ${{ github.action_path }}/pyproject.toml ${{ github.action_path }}/poetry.lock . && \
poetry install --no-root --without dev
shell: bash
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
id: changes
with:
filters: |
rules:
- '**/rules.yaml'
- name: Validate rules database
if: steps.changes.outputs.rules == 'true'
run: |
poetry run python -m boostsec.registry_validator.validate_rules_db \
--registry-path ${{ inputs.registry_path }}
shell: bash
env:
PYTHONPATH: ${{ github.action_path }}
BOOSTSEC_DOC_BASE_URL: ${{ inputs.docs_url }}
- name: Validate namespaces
run: |
poetry run python -m boostsec.registry_validator.validate_namespaces \
--registry-path ${{ inputs.registry_path }}
shell: bash
env:
PYTHONPATH: ${{ github.action_path }}
- name: Upload rules database
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: |
poetry run python -m boostsec.registry_validator.upload_rules_db \
--api-endpoint ${{ inputs.api_endpoint }} --api-token ${{ inputs.api_token }} \
--registry-path ${{ inputs.registry_path }}
shell: bash
env:
PYTHONPATH: ${{ github.action_path }}
BOOSTSEC_DOC_BASE_URL: ${{ inputs.docs_url }}