JSON tweaking for MD table.
This commit is contained in:
@@ -88,11 +88,12 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "Cleaning up quality gate response..."
|
echo "Cleaning up quality gate response..."
|
||||||
echo '${{ steps.quality-gate-check.outputs.quality-gate-result }}' > qg_input.txt
|
echo '${{ steps.quality-gate-check.outputs.quality-gate-result }}' > qg_input.txt
|
||||||
|
cat qg_input.txt
|
||||||
sed -E 's/([a-zA-Z0-9_]+):/\\"\1\\":/g; s/:([^",{}\[\]]+)/:"\1"/g' qg_input.txt > qg_raw.json
|
sed -E 's/([a-zA-Z0-9_]+):/\\"\1\\":/g; s/:([^",{}\[\]]+)/:"\1"/g' qg_input.txt > qg_raw.json
|
||||||
jq -c '.' qg_raw.json > qg_fixed_json.json
|
jq -c '.' qg_raw.json > qg_fixed_json.json
|
||||||
projstatus=$(jq -r '.projectStatus.status' qg_fixed_json.json)
|
projstatus=$(jq '.projectStatus.status' qg_fixed_json.json)
|
||||||
caycStatus=$(jq -r '.projectStatus.caycStatus' qg_fixed_json.json)
|
caycStatus=$(jq '.projectStatus.caycStatus' qg_fixed_json.json)
|
||||||
conditions=$(jq -r '.projectStatus.conditions' qg_fixed_json.json)
|
conditions=$(jq '.projectStatus.conditions' qg_fixed_json.json)
|
||||||
echo "projstatus=${projstatus}" >> $GITHUB_OUTPUT
|
echo "projstatus=${projstatus}" >> $GITHUB_OUTPUT
|
||||||
echo "caycStatus=${caycStatus}" >> $GITHUB_OUTPUT
|
echo "caycStatus=${caycStatus}" >> $GITHUB_OUTPUT
|
||||||
echo "conditions=${conditions}" >> $GITHUB_OUTPUT
|
echo "conditions=${conditions}" >> $GITHUB_OUTPUT
|
||||||
@@ -102,7 +103,7 @@ jobs:
|
|||||||
id: convert-json-to-md
|
id: convert-json-to-md
|
||||||
uses: buildingcash/json-to-markdown-table-action@v1.1.0
|
uses: buildingcash/json-to-markdown-table-action@v1.1.0
|
||||||
with:
|
with:
|
||||||
json: ${{ toJSON(steps.json-cleanup.outputs.conditions) }}
|
json: ${{ steps.json-cleanup.outputs.conditions }}
|
||||||
|
|
||||||
# - name: Start Gitea-Sonarqube Bot
|
# - name: Start Gitea-Sonarqube Bot
|
||||||
# uses: docker://justusbunsi/gitea-sonarqube-bot:v0.3.3
|
# uses: docker://justusbunsi/gitea-sonarqube-bot:v0.3.3
|
||||||
@@ -117,16 +118,16 @@ jobs:
|
|||||||
# --repository my-org/my-repo
|
# --repository my-org/my-repo
|
||||||
# --pull-request-id ${{ github.event.pull_request.number }}
|
# --pull-request-id ${{ github.event.pull_request.number }}
|
||||||
|
|
||||||
- name: Post SonarQube Results as Comment
|
# - name: Post SonarQube Results as Comment
|
||||||
run: |
|
# run: |
|
||||||
curl ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/${{ steps.cc-pr.outputs.pr_index }}/reviews \
|
# curl ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/${{ steps.cc-pr.outputs.pr_index }}/reviews \
|
||||||
-X POST \
|
# -X POST \
|
||||||
-H 'Accept: application/json' \
|
# -H 'Accept: application/json' \
|
||||||
-H 'Authorization: token ${{ secrets.BOT_GITEA_TOKEN }}' \
|
# -H 'Authorization: token ${{ secrets.BOT_GITEA_TOKEN }}' \
|
||||||
-H 'Content-Type: application/json' \
|
# -H 'Content-Type: application/json' \
|
||||||
-d '{
|
# -d '{
|
||||||
"body": "SonarQube analysis results:\n\n${{ steps.convert-json-to-md.outputs.table }}\n\n${{ steps.quality-gate.outputs.quality-gate-status }}"
|
# "body": "SonarQube analysis results:\n\n${{ steps.convert-json-to-md.outputs.table }}\n\n${{ steps.quality-gate.outputs.quality-gate-status }}"
|
||||||
}'
|
# }'
|
||||||
|
|
||||||
# Job 3: Merge PR if Quality Gate passes
|
# Job 3: Merge PR if Quality Gate passes
|
||||||
# merge-pr:
|
# merge-pr:
|
||||||
|
|||||||
Reference in New Issue
Block a user