Skip to content

Commit 848074b

Browse files
committed
fix: disable color output (NO_COLOR/TERM=dumb), use python to extract JSON
1 parent f298c9b commit 848074b

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

.github/workflows/vu1nz-scan.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,25 @@ jobs:
2929
id: scan
3030
env:
3131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
NO_COLOR: "1"
33+
TERM: dumb
3234
run: |
3335
vu1nz actions scan ${{ github.repository }} \
3436
--token "$GITHUB_TOKEN" \
3537
--json \
3638
--output "$RUNNER_TEMP/vu1nz-report" \
3739
| tee "$RUNNER_TEMP/vu1nz-scan-raw.txt" || true
38-
# vu1nz prints progress lines before the JSON and may include ANSI codes
39-
# Strip ANSI escape sequences, then extract the JSON object
40-
sed 's/\x1b\[[0-9;]*m//g' "$RUNNER_TEMP/vu1nz-scan-raw.txt" \
41-
| sed -n '/^{/,/^}/p' > "$RUNNER_TEMP/vu1nz-scan.json"
40+
# vu1nz prints progress lines before the JSON — extract just the JSON object
41+
python3 -c "
42+
import re, sys
43+
raw = open('$RUNNER_TEMP/vu1nz-scan-raw.txt').read()
44+
# strip any remaining ANSI escape sequences
45+
raw = re.sub(r'\x1b\[[0-9;]*m', '', raw)
46+
# find the JSON object
47+
start = raw.find('{')
48+
if start >= 0:
49+
sys.stdout.write(raw[start:])
50+
" > "$RUNNER_TEMP/vu1nz-scan.json"
4251
4352
- name: Claude AI review
4453
if: env.HAS_CLAUDE_KEY == 'true'

0 commit comments

Comments
 (0)