From f30a96cbb7f9c4e32ed3e6d6faddc443c5e1a431 Mon Sep 17 00:00:00 2001 From: "Trez.One" Date: Wed, 18 Dec 2024 08:33:50 -0500 Subject: [PATCH] JSON formatting fixes... --- .gitea/workflows/branch-sonarscan-pr-merge.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/branch-sonarscan-pr-merge.yml b/.gitea/workflows/branch-sonarscan-pr-merge.yml index 666f7a77..385e4d52 100644 --- a/.gitea/workflows/branch-sonarscan-pr-merge.yml +++ b/.gitea/workflows/branch-sonarscan-pr-merge.yml @@ -84,18 +84,11 @@ jobs: - name: Create Input File run: | echo "Creating invalid input..." - cat < input.txt - ${{ steps.quality-gate-check.outputs.quality-gate-result }} - EOF - - - name: Fix JSON Formatting - id: fix-json - run: | - echo "Fixing invalid JSON..." - sed -E 's/([^,{:]*):/\1":/g; s/: ([^,}\]]*)/: "\1"/g' input.txt | \ - sed 's/,\s*}/}/g; s/,\s*\]/]/g' > fixed.json + echo '${{ steps.quality-gate-check.outputs.quality-gate-result }}' > input.txt + sed -E 's/([a-zA-Z0-9_]+):/\\"\1\\":/g; s/:([^",{}\[\]]+)/:"\1"/g' input.txt > fixed.json + echo "Fixed JSON:" cat fixed.json - + - name: Validate Fixed JSON run: | echo "Validating JSON with jq..."