Skip to content

Commit

Permalink
only add shortcodes to sa rule pages
Browse files Browse the repository at this point in the history
  • Loading branch information
StefonSimmons committed Apr 16, 2024
1 parent d54af22 commit 9868847
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions local/bin/py/build/actions/pull_and_push_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ def pull_and_push_folder(content, content_dir):
for file_name in chain.from_iterable(glob.iglob(pattern, recursive=True) for pattern in content["globs"]):
print(f'Processing: {file_name.replace("./integrations_data/extracted", "")}')
source_comment = f"<!-- SOURCED FROM https://github.com/DataDog/{content['repo_name']} -->\n"
try_rule_cta = "\n{{< try-rule-cta >}}"
try_rule_banner = "\n{{< try-rule-banner >}}"

# add shortcodes for static analysis rules
is_static_analysis_rules = content["options"].get("dest_dir", "") == "/code_analysis/static_analysis_rules/"
try_rule_cta = "\n{{< try-rule-cta >}}" if is_static_analysis_rules else ""
try_rule_banner = "\n{{< try-rule-banner >}}" if is_static_analysis_rules else ""

with open(file_name, mode="r+", encoding="utf-8", errors="ignore") as f:
file_name_path = Path(file_name)
# get the path without integrations_data/extracted/<repo_name>/
Expand Down

0 comments on commit 9868847

Please sign in to comment.