Skip to content

Commit b623694

Browse files
Merge pull request #4 from johnfosborneiii/main
Add sarif gen fixes
2 parents 21db815 + bdf5e4f commit b623694

2 files changed

Lines changed: 5 additions & 17 deletions

File tree

.github/workflows/generate-sarif.yaml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,6 @@ jobs:
3232
run: python generate-malcontent-sarif.py
3333

3434
- name: Upload SARIF to GitHub
35-
uses: github/codeql-action/upload-sarif@v2
35+
uses: github/codeql-action/upload-sarif@v3
3636
with:
3737
sarif_file: scans/malcontent-report.sarif
38-
39-
- name: Commit and push updated SARIF file
40-
run: |
41-
git config user.name "GitHub Actions"
42-
git config user.email "actions@github.com"
43-
git add scans/malcontent-report.sarif
44-
if git diff --cached --quiet; then
45-
echo "No changes to commit."
46-
else
47-
git commit -m "Update malware diff SARIF Report: v8.3.40 → v8.3.41"
48-
git push origin "${GITHUB_REF#refs/heads/}"

generate-malcontent-sarif.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
output_path = Path("scans/malcontent-report.sarif")
99

1010
# === DETERMINE LOCAL REPO ROOT ===
11-
local_repo_root = Path.cwd() / sub_repo_path
11+
repo_root = Path(__file__).resolve().parent
12+
local_repo_root = repo_root / sub_repo_path
1213
if not local_repo_root.exists():
1314
raise FileNotFoundError(f"Expected repo root not found: {local_repo_root}")
1415

@@ -40,8 +41,7 @@
4041
},
4142
"versionControlProvenance": [{
4243
"repositoryUri": repository_uri,
43-
"revisionId": commit_sha,
44-
"uriBaseId": "%SRCROOT%"
44+
"revisionId": commit_sha
4545
}],
4646
"results": []
4747
}]
@@ -87,8 +87,7 @@
8787
"locations": [{
8888
"physicalLocation": {
8989
"artifactLocation": {
90-
"uri": str(rel_path),
91-
"uriBaseId": "%SRCROOT%"
90+
"uri": str(rel_path)
9291
},
9392
"region": {
9493
"startLine": 1

0 commit comments

Comments
 (0)