Skip to content

Commit d942a24

Browse files
authored
Merge branch 'main' into json_api_updates
2 parents ddafd48 + 7b56321 commit d942a24

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos:
88
- id: detect-private-key
99
- id: forbid-submodules
1010
- repo: https://github.com/astral-sh/ruff-pre-commit
11-
rev: v0.11.0
11+
rev: v0.11.2
1212
hooks:
1313
- id: ruff
1414
args: [ --fix ]

contentctl/actions/release_notes.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
from contentctl.objects.config import release_notes
2-
from git import Repo
3-
import re
4-
import yaml
51
import pathlib
2+
import re
63
from typing import List, Union
74

5+
import yaml
6+
from git import Repo
7+
8+
from contentctl.objects.config import release_notes
9+
810

911
class ReleaseNotes:
1012
def create_notes(
@@ -171,13 +173,13 @@ def create_notes(
171173

172174
def release_notes(self, config: release_notes) -> None:
173175
### Remove hard coded path
174-
directories = [
175-
"detections/",
176-
"stories/",
177-
"macros/",
178-
"lookups/",
179-
"playbooks/",
180-
"ssa_detections/",
176+
directories: list[pathlib.Path] = [
177+
config.path / "detections",
178+
config.path / "stories",
179+
config.path / "macros",
180+
config.path / "lookups",
181+
config.path / "playbooks",
182+
config.path / "ssa_detections",
181183
]
182184

183185
repo = Repo(config.path)
@@ -229,7 +231,7 @@ def release_notes(self, config: release_notes) -> None:
229231
file_path = pathlib.Path(diff.a_path)
230232

231233
# Check if the file is in the specified directories
232-
if any(str(file_path).startswith(directory) for directory in directories):
234+
if any(file_path.is_relative_to(directory) for directory in directories):
233235
# Check if a file is Modified
234236
if diff.change_type == "M":
235237
modified_files.append(file_path)

contentctl/output/templates/savedsearches_detections.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ action.notable.param.security_domain = {{ detection.tags.security_domain }}
6868
action.notable.param.severity = {{ detection.severity }}
6969
{% endif %}
7070
{% if detection.deployment.alert_action.email %}
71+
action.email = 1
7172
action.email.subject.alert = {{ detection.deployment.alert_action.email.subject | custom_jinja2_enrichment_filter(detection) | escapeNewlines() }}
7273
action.email.to = {{ detection.deployment.alert_action.email.to }}
7374
action.email.message.alert = {{ detection.deployment.alert_action.email.message | custom_jinja2_enrichment_filter(detection) | escapeNewlines() }}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ gitpython = "^3.1.43"
3333
setuptools = ">=69.5.1,<79.0.0"
3434

3535
[tool.poetry.group.dev.dependencies]
36-
ruff = "^0.11.0"
36+
ruff = "^0.11.2"
3737

3838
[build-system]
3939
requires = ["poetry-core>=1.0.0"]

0 commit comments

Comments
 (0)