JSON formatting fixes...
This commit is contained in:
@@ -84,18 +84,11 @@ jobs:
|
|||||||
- name: Create Input File
|
- name: Create Input File
|
||||||
run: |
|
run: |
|
||||||
echo "Creating invalid input..."
|
echo "Creating invalid input..."
|
||||||
cat <<EOF > input.txt
|
echo '${{ steps.quality-gate-check.outputs.quality-gate-result }}' > input.txt
|
||||||
${{ steps.quality-gate-check.outputs.quality-gate-result }}
|
sed -E 's/([a-zA-Z0-9_]+):/\\"\1\\":/g; s/:([^",{}\[\]]+)/:"\1"/g' input.txt > fixed.json
|
||||||
EOF
|
echo "Fixed JSON:"
|
||||||
|
|
||||||
- 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
|
|
||||||
cat fixed.json
|
cat fixed.json
|
||||||
|
|
||||||
- name: Validate Fixed JSON
|
- name: Validate Fixed JSON
|
||||||
run: |
|
run: |
|
||||||
echo "Validating JSON with jq..."
|
echo "Validating JSON with jq..."
|
||||||
|
|||||||
Reference in New Issue
Block a user