Skip to content

Commit

Permalink
Read raw file contents directly instead of using REST API
Browse files Browse the repository at this point in the history
REST API endpoint returns base64 encoded data which then needs to be decoded.
Can simply read the Raw file contents from the publicly available file.
  • Loading branch information
Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Sep 21, 2024
1 parent 8f72539 commit 8f6d5dc
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/image_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,8 @@ jobs:
- name: Fetch server image tag
id: get-server-tag
run: |
response=$(curl -s \
-H "Authorization: Bearer ${{ secrets.GH_FG_PAT_TAGS }}" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/MukuFlash03/e-mission-server/contents/.env?ref=cleanup-cicd)
content=$(echo "$response" | jq -r .content)
decoded_content=$(echo "$content" | base64 --decode)
SERVER_IMAGE_TAG=$(echo "$decoded_content" | grep "SERVER_IMAGE_TAG=" | cut -d'=' -f2)
response=$(curl -s https://raw.githubusercontent.com/MukuFlash03/e-mission-server/refs/heads/cleanup-cicd/.env)
SERVER_IMAGE_TAG=$(echo "$response" | grep "SERVER_IMAGE_TAG=" | cut -d'=' -f2)
echo "SERVER_IMAGE_TAG=$SERVER_IMAGE_TAG" >> "$GITHUB_OUTPUT"
- name: Set docker image tags
Expand Down

0 comments on commit 8f6d5dc

Please sign in to comment.