Skip to content

Commit

Permalink
update action script
Browse files Browse the repository at this point in the history
  • Loading branch information
zpatronus committed Dec 9, 2024
1 parent 19b8dc5 commit 27babbc
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,26 @@ jobs:
echo "code=$TOTP_CODE" >> $GITHUB_ENV
- name: Send POST request to Verifier
id: send_post
run: |
curl -X POST "${{ secrets.FLASK_VERIFIER_URL }}/verify" \
-d "code=${{ env.code }}"
response=$(curl -X POST "${{ secrets.FLASK_VERIFIER_URL }}/verify" \
-d "code=${{ env.code }}" -s)
echo "Response: $response"
echo "$response" > response.json
success=$(echo $response | jq -r '.success')
message=$(echo $response | jq -r '.message')
if [[ "$success" == "false" ]]; then
echo "Message: $message"
echo "Try manual deployment"
exit 1
else
echo "Verification succeeded."
fi
env:
code: ${{ env.code }}
FLASK_VERIFIER_URL: ${{ secrets.FLASK_VERIFIER_URL }}

- name: Handle Success
if: steps.send_post.outputs.success == 'true'
run: echo "Action completed successfully!"

0 comments on commit 27babbc

Please sign in to comment.