-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (31 loc) · 1.05 KB
/
trigger-validator.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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!"