Skip to content

Commit

Permalink
build: Update API version for GitHub API
Browse files Browse the repository at this point in the history
  • Loading branch information
ImBIOS committed Oct 2, 2023
1 parent 475608c commit cb78f73
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ jobs:
- name: Check for new releases in nodejs/docker-node
id: nodejs
run: |
curl -s https://api.github.com/repos/nodejs/docker-node/releases/latest | jq -r '.tag_name' > latest_nodejs.txt
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/nodejs/docker-node/releases/latest | jq -r '.tag_name' > latest_nodejs.txt
if [[ -f last_nodejs.txt && $(cat last_nodejs.txt) != $(cat latest_nodejs.txt) ]]; then
echo "New NodeJS version found."
echo "new-release=true" >> $GITHUB_ENV
Expand All @@ -38,7 +41,7 @@ jobs:
- name: Check for new releases in oven-sh/bun
id: bun
if: env.nodejs-new-release == 'false'
if: env.nodejs-new-release == 'true'
run: |
curl -s https://api.github.com/repos/oven-sh/bun/releases/latest | jq -r '.tag_name' > latest_bun.txt
if [[ -f last_bun.txt && $(cat last_bun.txt) != $(cat latest_bun.txt) ]]; then
Expand All @@ -52,6 +55,7 @@ jobs:
echo "bun-new-release=${{ env.new-release }}" >> $GITHUB_ENV
- name: Determine if any new releases
if: env.nodejs-new-release == 'true' || env.bun-new-release == 'true'
run: echo "any-new-release=$(if [[ '${{ env.nodejs-new-release }}' == 'true' || '${{ env.bun-new-release }}' == 'true' ]]; then echo 'true'; else echo 'false'; fi)" >> $GITHUB_ENV

# Cache versions regardless of whether a new release is found
Expand Down

0 comments on commit cb78f73

Please sign in to comment.