Skip to content

Datacap for Charly Lopez #149

Datacap for Charly Lopez

Datacap for Charly Lopez #149

name: Validate Application Trigger
on:
pull_request:
types:
- opened
- synchronize
pull_request_review:
types:
- submitted
jobs:
validate-trigger:
runs-on: ubuntu-latest
env:
DOMAIN: ${{ secrets.DOMAIN }}
steps:
- name: Call Backend to Validate Application Trigger
id: validate
run: |
echo "Calling backend to validate with pr_number: ${{ github.event.pull_request.number }} and user_handle: ${{ github.actor }}"
RESPONSE=$(curl --header "Content-Type: application/json" \
--request POST \
--data '{"pr_number": "'${{ github.event.pull_request.number }}'", "user_handle": "'${{ github.actor }}'"}' \
"${DOMAIN}/application/trigger/validate")
echo "Response from validation: $RESPONSE"
if [ "$RESPONSE" != "true" ]; then
echo "Error: Validation returned false"
exit 1
fi
- name: Validation Success
if: steps.validate.outcome == 'success'
run: echo "Validation successful!"