Skip to content

Commit

Permalink
fix cronjob so it properly detects nonsense responses from github
Browse files Browse the repository at this point in the history
  • Loading branch information
tibers committed Mar 16, 2022
1 parent 69fcdee commit 1d20cc8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Get their version
# The github API gave us a 500 the other day and it caused a headache...
run: |
THEIR_VERSION=$(curl -s "https://api.github.com/repos/anchore/grype/releases/latest" | grep "browser_download_url" | cut -d '"' -f 4 | cut -f 8 -d \/ | uniq)
until curl -fs "https://api.github.com/repos/anchore/grype/releases/latest" -o their_version.txt ; do echo "Waiting for GitHub API..." ; sleep 30 ; done
THEIR_VERSION=$(cat ./their_version.txt | grep "browser_download_url" | cut -d '"' -f 4 | cut -f 8 -d \/ | uniq)
echo THEIR_VERSION=$THEIR_VERSION >> $GITHUB_ENV
- name: Check out Code
uses: actions/checkout@v2
Expand Down

0 comments on commit 1d20cc8

Please sign in to comment.