From 8fd4ef3c2d2c866151b344c40162b50e15b41718 Mon Sep 17 00:00:00 2001 From: Musiker15 Date: Tue, 10 Nov 2026 12:35:43 +0100 Subject: [PATCH 1/4] Ergebniszeile genau nach Vorgabe, Beschreibung ganz, Zeile ganzzahlig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drei Nachträge zu #59: eine abweichende Ergebniszeile wurde grün, eine Beschreibung als Liste wurde abgeschnitten, und eine Zeile wie 1.5 machte die SARIF-Datei ungültig. --- .github/workflows/security-review.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/security-review.yml b/.github/workflows/security-review.yml index 83bcb0d..3b8403e 100644 --- a/.github/workflows/security-review.yml +++ b/.github/workflows/security-review.yml @@ -1341,7 +1341,9 @@ jobs: if filled and lines[filled[-1]].strip() == 'REVIEW_COMPLETE': found = None if len(filled) >= 2: - found = re.fullmatch(r'REVIEW_RESULT:\s*(clean|findings)', lines[filled[-2]].strip()) + # Exactly as the prompt writes it, so a line in another form + # is unclear rather than a result. + found = re.fullmatch(r'REVIEW_RESULT: (clean|findings)', lines[filled[-2]].strip()) result = found.group(1) if found else 'unclear' # Not a result line, the line before REVIEW_COMPLETE belongs to # the report and goes through the same filter as the rest. @@ -1377,8 +1379,10 @@ jobs: 'file': entry['file'] if isinstance(entry.get('file'), str) else '', 'title': entry['title'] if isinstance(entry.get('title'), str) else str(entry.get('title') or 'Befund'), 'severity': entry['severity'] if entry.get('severity') in ('high', 'medium', 'low') else 'medium', + # In full: the public report no longer holds it. 'description': entry['description'] if isinstance(entry.get('description'), str) - else str(entry.get('description') or '')[:4000], + else json.dumps(entry.get('description'), ensure_ascii=False) + if entry.get('description') is not None else '', } for entry in entries] else: private = [{'file': '', 'line': 1, 'title': 'Privater Befund, nicht lesbar', @@ -1446,7 +1450,7 @@ jobs: message: {text: ((.value.title // "Befund") + ": " + (.value.description // ""))}, locations: [{physicalLocation: { artifactLocation: {uri: ((.value.file // "") | if . == "" then "README.md" else . end)}, - region: {startLine: ((.value.line // 1) | if type == "number" and . > 0 then . else 1 end)} + region: {startLine: ((.value.line // 1) | if type == "number" and . > 0 and . == floor then . else 1 end)} }}] }] }] From 2f2c17db42463d5764cc41e471a9074a11eb072a Mon Sep 17 00:00:00 2001 From: Musiker15 Date: Tue, 10 Nov 2026 12:42:25 +0100 Subject: [PATCH 2/4] =?UTF-8?q?SARIF=20geht=20=C3=BCber=20eine=20Datei=20a?= =?UTF-8?q?n=20jq,=20nicht=20=C3=BCber=20ein=20Argument?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lange Befunde hätten die Grenze von Linux für ein Argument überschritten; über der Grenze von GitHub bricht der Schritt mit einer Meldung ab. --- .github/workflows/security-review.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/security-review.yml b/.github/workflows/security-review.yml index 3b8403e..7eaaf9f 100644 --- a/.github/workflows/security-review.yml +++ b/.github/workflows/security-review.yml @@ -1455,9 +1455,18 @@ jobs: }] }] }' "$RUNNER_TEMP/private/findings.json" > "$RUNNER_TEMP/private/findings.sarif" + # Through a file, not an argument: a long finding would pass the + # limit Linux sets for one argument (128 KiB). GitHub takes at most + # 10 MB compressed; above that the step says so and fails. + gzip -c "$RUNNER_TEMP/private/findings.sarif" > "$RUNNER_TEMP/private/findings.sarif.gz" + if [ "$(wc -c < "$RUNNER_TEMP/private/findings.sarif.gz")" -gt 10000000 ]; then + echo "Die privaten Befunde sind gepackt größer als 10 MB, GitHub nimmt sie so nicht an." + exit 1 + fi + base64 -w0 "$RUNNER_TEMP/private/findings.sarif.gz" > "$RUNNER_TEMP/private/findings.sarif.b64" jq -n --arg sha "$BASE_SHA" --arg ref "refs/heads/$BASE_REF" \ - --arg sarif "$(gzip -c "$RUNNER_TEMP/private/findings.sarif" | base64 -w0)" \ - '{commit_sha: $sha, ref: $ref, sarif: $sarif}' > "$RUNNER_TEMP/private/upload.json" + --rawfile sarif "$RUNNER_TEMP/private/findings.sarif.b64" \ + '{commit_sha: $sha, ref: $ref, sarif: ($sarif | rtrimstr("\n"))}' > "$RUNNER_TEMP/private/upload.json" gh api --method POST "repos/$GITHUB_REPOSITORY/code-scanning/sarifs" \ --input "$RUNNER_TEMP/private/upload.json" > /dev/null echo "$count private Befunde als Code-Scanning-Alerts abgelegt." From ee5faec6a807cfb0ea3891b269dd578d33e79147 Mon Sep 17 00:00:00 2001 From: Musiker15 Date: Tue, 10 Nov 2026 12:46:26 +0100 Subject: [PATCH 3/4] Zeile eines Alerts hat eine Obergrenze Ohne sie gingen Werte wie 1e300 als Zeile an GitHub. --- .github/workflows/security-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/security-review.yml b/.github/workflows/security-review.yml index 7eaaf9f..664ab3c 100644 --- a/.github/workflows/security-review.yml +++ b/.github/workflows/security-review.yml @@ -1450,7 +1450,7 @@ jobs: message: {text: ((.value.title // "Befund") + ": " + (.value.description // ""))}, locations: [{physicalLocation: { artifactLocation: {uri: ((.value.file // "") | if . == "" then "README.md" else . end)}, - region: {startLine: ((.value.line // 1) | if type == "number" and . > 0 and . == floor then . else 1 end)} + region: {startLine: ((.value.line // 1) | if type == "number" and . >= 1 and . < 2147483648 and . == floor then floor else 1 end)} }}] }] }] From 841c0feb990bfa39050251b183ec39d0fbb7f2f6 Mon Sep 17 00:00:00 2001 From: Musiker15 Date: Tue, 10 Nov 2026 12:56:45 +0100 Subject: [PATCH 4/4] Ergebniszeile ohne Leerzeichen davor oder dahinter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mit strip() galt auch eine eingerückte oder nachgestellte Zeile als Ergebnis. --- .github/workflows/security-review.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/security-review.yml b/.github/workflows/security-review.yml index 664ab3c..e39f85b 100644 --- a/.github/workflows/security-review.yml +++ b/.github/workflows/security-review.yml @@ -1341,9 +1341,10 @@ jobs: if filled and lines[filled[-1]].strip() == 'REVIEW_COMPLETE': found = None if len(filled) >= 2: - # Exactly as the prompt writes it, so a line in another form - # is unclear rather than a result. - found = re.fullmatch(r'REVIEW_RESULT: (clean|findings)', lines[filled[-2]].strip()) + # Exactly as the prompt writes it, so a line in another form, + # extra blanks around it included, is unclear rather than a + # result; only the CR of a CRLF line end goes. + found = re.fullmatch(r'REVIEW_RESULT: (clean|findings)', lines[filled[-2]].rstrip('\r')) result = found.group(1) if found else 'unclear' # Not a result line, the line before REVIEW_COMPLETE belongs to # the report and goes through the same filter as the rest.