Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
datacap-bot[bot] authored Mar 20, 2024
1 parent 026fe99 commit a79f204
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/trigger-validator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Validate Application Trigger

on:
pull_request:
types:
- opened
- synchronize

jobs:
validate-trigger:
runs-on: ubuntu-latest
env:
BACKEND_URL: https://fp-core-prod.dp04sa0tdc6pk.us-east-1.cs.amazonlightsail.com
steps:
- name: Call Backend to Validate Application Trigger
id: validate
run: |
USER_HANDLE="${{ github.actor }}"
REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2)
OWNER_NAME="${{ github.repository_owner }}"
PR_NUMBER="${{ github.event.pull_request.number }}"
echo "Calling backend to validate with pr_number: $PR_NUMBER, user_handle: $USER_HANDLE, repo: $REPO_NAME, and owner: $OWNER_NAME"
RESPONSE=$(curl --header "Content-Type: application/json" \
--request POST \
--data '{"pr_number": "'$PR_NUMBER'", "user_handle": "'$USER_HANDLE'", "repo": "'$REPO_NAME'", "owner": "'$OWNER_NAME'"}' \
"${BACKEND_URL}/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!"

0 comments on commit a79f204

Please sign in to comment.