Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
ci: profile check in db (#9638)
Browse files Browse the repository at this point in the history
* feat: Json Profile Action to check API

* chore: updated filename and output

* Update .github/workflows/check-profile.yml

* Update .github/workflows/check-profile.yml

---------

Co-authored-by: Eddie Jaoude <[email protected]>
  • Loading branch information
akkshitgupta and eddiejaoude authored Oct 28, 2023
1 parent cf95cd9 commit 81f61ba
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/check-profile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: JSON Profile API check

on:
pull_request:
paths:
- "data/**.json"

jobs:
api-response-source:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

# Make the API request corresponding to the pull request author and outputs the data of the user as JSON string
- name: Make API request
id: myRequest
uses: fjogeleit/http-request-action@v1
with:
url: "https://biodrop.io/api/profiles/${{ github.event.pull_request.user.login }}"

# fail the job if the source is database
- name: Check if source is database
if: fromJson(steps.myRequest.outputs.response).source == 'database'
run: |
echo "${{ github.event.pull_request.user.login }}'s Profile is already in database"
exit 1

0 comments on commit 81f61ba

Please sign in to comment.