mirror of
https://github.com/elastic/detection-rules
synced 2026-06-08 14:00:08 +00:00
356c713ee3
* Add permissions blocks to workflows
* Add cosmetic read blocks for consistency
Co-authored-by: Arpit Jain <3242828+arpitjain099@users.noreply.github.com>
(cherry picked from commit 5a4d781939)
53 lines
1.0 KiB
YAML
53 lines
1.0 KiB
YAML
name: Code checks
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main", "7.*", "8.*", "9.*" ]
|
|
pull_request:
|
|
branches: [ "*" ]
|
|
paths:
|
|
- 'detection_rules/**/*.py'
|
|
- 'hunting/**/*.py'
|
|
- 'tests/**/*.py'
|
|
- 'lib/**/*.py'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
code-checks:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Set up Python 3.13
|
|
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
|
|
with:
|
|
python-version: '3.13'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip cache purge
|
|
pip install .[dev]
|
|
|
|
- name: Linting check
|
|
run: |
|
|
ruff check --exit-non-zero-on-fix
|
|
|
|
- name: Formatting check
|
|
run: |
|
|
ruff format --check
|
|
|
|
- name: Pyright check
|
|
run: |
|
|
pyright
|
|
|
|
- name: Python License Check
|
|
run: |
|
|
python -m detection_rules dev license-check
|