Skip to content

Commit 3ba72df

Browse files
ttw225Lee-W
authored andcommitted
config: ignore the unreachable pygments advisory and gate on the rest
1 parent f7b350e commit 3ba72df

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

.github/workflows/security-audit.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ on:
1818

1919
jobs:
2020
audit:
21-
# Non-blocking (continue-on-error) because pygments PYSEC-2026-2987
22-
# cannot be fixed while pelican caps pygments<2.20.0 — see issue #219.
23-
# Make this job blocking once that finding is resolved or ignored.
21+
# Advisories we knowingly accept are listed in IGNORED_VULNERABILITIES in
22+
# tasks.py, each with the condition for dropping it. A red job here means
23+
# a finding nobody has triaged yet.
2424
runs-on: ubuntu-latest
25-
continue-on-error: true
2625
steps:
2726
- name: Check out
2827
uses: actions/checkout@v7

tasks.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@
6767
]
6868

6969

70+
# Advisories we accept, with the condition for dropping each. See issue #219.
71+
#
72+
# PYSEC-2026-2987: ReDoS in the Pygments ADL lexer. Fixed in Pygments 2.20.0,
73+
# which Pelican's pygments<2.20.0 cap puts out of reach. This blog has no ADL
74+
# content. Drop when Pelican relaxes the cap or the advisory is withdrawn.
75+
IGNORED_VULNERABILITIES = [
76+
"PYSEC-2026-2987",
77+
]
78+
79+
7080
@task
7181
def clean(context: Context) -> None:
7282
"""Remove generated files"""
@@ -215,7 +225,8 @@ def format(context: Context) -> None:
215225
@task
216226
def security_check(context: Context) -> None:
217227
"""Run pip-audit on dependencies"""
218-
context.run("""uv run pip-audit""")
228+
ignored = " ".join(f"--ignore-vuln {vuln}" for vuln in IGNORED_VULNERABILITIES)
229+
context.run(f"uv run pip-audit {ignored}")
219230

220231

221232
@task

0 commit comments

Comments
 (0)