From 81f61baecf0d3adf2b3f0693ab730049cbcffcc7 Mon Sep 17 00:00:00 2001 From: Akshit Gupta Date: Sat, 28 Oct 2023 13:37:43 +0530 Subject: [PATCH] ci: profile check in db (#9638) * 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 --- .github/workflows/check-profile.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/check-profile.yml diff --git a/.github/workflows/check-profile.yml b/.github/workflows/check-profile.yml new file mode 100644 index 00000000000..606caecd5e0 --- /dev/null +++ b/.github/workflows/check-profile.yml @@ -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