Skip to content

Commit

Permalink
chore: change to multi-string format
Browse files Browse the repository at this point in the history
  • Loading branch information
tianzhou committed Feb 23, 2024
1 parent c533c63 commit f12811b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/sql-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ jobs:
--arg statement "SELECT * FROM t" \
--arg database "instances/prod-instance/databases/example" \
'$ARGS.named')
echo "request_body=${request_body}" >> $GITHUB_OUTPUT
echo "request_body<<EOF" >> $GITHUB_OUTPUT
echo "$request_body" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Call SQL check API
id: call_sql_check
Expand All @@ -39,17 +41,15 @@ jobs:
-H "Authorization: Bearer ${{ steps.exchange_token.outputs.bytebase_token }}" \
-d "${{ steps.prepare_request.outputs.request_body }}")
http_status=$(echo "$response" | grep -oE 'HTTPSTATUS:[0-9]+' | grep -oE '[0-9]+')
echo "http_status=${http_status}" >> $GITHUB_OUTPUT
- name: Process response
run: |
echo "HTTP status code: ${{ steps.call_sql_check.outputs.http_status }}"
echo "::set-output name=status_code::${{ steps.call_sql_check.outputs.http_status }}"
if [ ${{ steps.call_sql_check.outputs.http_status }} != 200 ]; then
echo "::error ::Failed to check SQL with response code ${{ steps.call_sql_check.outputs.http_status }}"
exit 1
fi
value=$(jq -r '.advices' response.json)
echo "::set-output name=extracted_value::$value"
echo "Advices: ${value}"

0 comments on commit f12811b

Please sign in to comment.