Skip to content

Commit fa5de1c

Browse files
dfa1claude
andcommitted
ci: local_summary.py reads fixed file names, not CLI arguments
Sonar pythonsecurity:S8707 (path traversal) flagged opening paths taken from sys.argv. The workflow always wrote jev.txt and jmh.json in the working directory, so the script now opens exactly those and takes no arguments. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent a1a183d commit fa5de1c

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎.github/scripts/local_summary.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
"""Markdown for the GitHub job summary: agreement with Jev (JevComparison output) and throughput (JMH JSON).
2-
Usage: python3 .github/scripts/local_summary.py jev.txt jmh.json >> $GITHUB_STEP_SUMMARY"""
2+
Reads jev.txt and jmh.json from the working directory, the files the Local engines workflow writes there.
3+
Usage: python3 .github/scripts/local_summary.py >> $GITHUB_STEP_SUMMARY"""
34
import json
45
import math
56
import os
67
import platform
78
import re
8-
import sys
99

10-
jev_file, jmh_file = sys.argv[1], sys.argv[2]
10+
# fixed names, not arguments: nothing outside this workflow decides which files get opened
11+
jev_file, jmh_file = "jev.txt", "jmh.json"
1112
print(f"## Local engines on `{os.environ.get('RUNNER_OS', platform.system())}` "
1213
f"({platform.machine()}, {os.cpu_count()} CPUs)\n")
1314

‎.github/workflows/local.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ jobs:
7474
7575
- name: Summary
7676
if: always()
77-
run: python3 .github/scripts/local_summary.py jev.txt jmh.json >> "$GITHUB_STEP_SUMMARY"
77+
run: python3 .github/scripts/local_summary.py >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)