diff --git a/.github/workflows/check-new-release.yml b/.github/workflows/check-new-release.yml new file mode 100644 index 0000000..c314493 --- /dev/null +++ b/.github/workflows/check-new-release.yml @@ -0,0 +1,33 @@ +name: Check there is a new release available + +# RELEASE_STRING should be updated when a new release is available +env: + RELEASE_URL: 'https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads' + RELEASE_STRING: 'Released: July 4, 2024' + +on: + schedule: + # Runs every day at 19:30 + - cron: '30 19 * * *' + push: + # On push only when this file is changed + branches: '*' + paths: + - ".github/workflows/check-new-release.yml" + +jobs: + check-new-release: + name: Check for a new release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: pip install requests + - name: Check HTML to see if there is a new release + shell: bash + run: | + python3 - << EOF + import os, requests; + html = requests.get(os.environ['RELEASE_URL']).text; + string_exists = os.environ['RELEASE_STRING'] in html; + exit(0 if string_exists else 1); + EOF diff --git a/.github/workflows/check-urls.yml b/.github/workflows/check-urls.yml index d29e1f8..b501201 100644 --- a/.github/workflows/check-urls.yml +++ b/.github/workflows/check-urls.yml @@ -6,8 +6,7 @@ on: - cron: '30 19 * * *' jobs: - # Test and check build errors - test-build: + check-urls: name: Check file URLs runs-on: ubuntu-latest steps: