... Ahhhh.
This commit is contained in:
@@ -108,18 +108,35 @@ jobs:
|
|||||||
PR_NUMBER: ${{ needs.check-and-create-pr.outputs.pr_number }}
|
PR_NUMBER: ${{ needs.check-and-create-pr.outputs.pr_number }}
|
||||||
SQ_RESULTS: ${{ steps.convert-json-to-md.outputs.table }}
|
SQ_RESULTS: ${{ steps.convert-json-to-md.outputs.table }}
|
||||||
QG_STATUS: ${{ steps.quality-gate.outputs.quality-gate-status }}
|
QG_STATUS: ${{ steps.quality-gate.outputs.quality-gate-status }}
|
||||||
|
RINOA_GITEA_URL: ${{ vars.RINOA_GITEA_URL }}
|
||||||
|
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||||
|
BOT_GITEA_TOKEN: ${{ secrets.BOT_GITEA_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
payload=$(jq -n --arg body "SonarQube analysis results:\n\n${{ env.SQ_RESULTS }}\n\n${{ env.QG_STATUS }}" \
|
payload=$(jq -n \
|
||||||
'{
|
--arg body "SonarQube analysis results:\n\n${SQ_RESULTS}\n\n${QG_STATUS}" \
|
||||||
body: $body
|
'{ body: $body }')
|
||||||
}')
|
|
||||||
echo "${payload}"
|
|
||||||
curl ${{ vars.RINOA_GITEA_URL }}/api/v1/repos/${{ github.repository }}/pulls/${PR_NUMBER}/reviews \
|
echo "Constructed Payload:"
|
||||||
-X 'POST' \
|
echo "$payload"
|
||||||
-H 'Accept: application/json' \
|
|
||||||
-H 'Authorization: token ${{ secrets.BOT_GITEA_TOKEN }}' \
|
response=$(curl -s -o response.json -w "%{http_code}" \
|
||||||
-H 'Content-Type: application/json' \
|
-X POST \
|
||||||
-d '${{ env.payload }}' -s -w "%http_code%" -i
|
-H "Accept: application/json" \
|
||||||
|
-H "Authorization: token ${BOT_GITEA_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "$payload" \
|
||||||
|
"${RINOA_GITEA_URL}/api/v1/repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/reviews")
|
||||||
|
|
||||||
|
echo "HTTP Status Code: $response"
|
||||||
|
echo "Response Body:"
|
||||||
|
cat response.json
|
||||||
|
|
||||||
|
if [ "$response" -ne 200 ]; then
|
||||||
|
echo "Error: Failed to post comment. HTTP Status Code: $response"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# 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