Skip to content

Datacap for National Human Genome Research Instititue #40

Datacap for National Human Genome Research Instititue

Datacap for National Human Genome Research Instititue #40

Workflow file for this run

name: Check Application Changes
on:
pull_request:
types:
- opened
- synchronize
jobs:
check-for-changes:
runs-on: ubuntu-latest
env:
BACKEND_URL: https://api.allocator.tech
steps:
- name: Call Backend to Check Application Changes
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 check changes 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/check_for_changes")
echo "Response from Check Application Changes: $RESPONSE"
if [ "$RESPONSE" != "true" ]; then
echo "Error: Check Application Changes returned false"
exit 1
fi
- name: Check Application Changes Success
if: steps.validate.outcome == 'success'
run: echo "Check Application Changes successful!"