diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6fabcd132..e708eedb8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -40,7 +40,17 @@ jobs: - name: Retrieval of Builder Scripts run: | # Real Grav URL - curl --silent -H "Authorization: token ${{ secrets.GLOBAL_TOKEN }}" -H "Accept: application/vnd.github.v3.raw" ${{ secrets.BUILD_SCRIPT_URL_18 }} --output build-grav.sh + http_code=$(curl --silent --write-out "%{http_code}" \ + -H "Authorization: token ${{ secrets.GLOBAL_TOKEN }}" \ + -H "Accept: application/vnd.github.v3.raw" \ + "${{ secrets.BUILD_SCRIPT_URL_18 }}" \ + --output build-grav.sh) + if [ "$http_code" != "200" ] || ! head -1 build-grav.sh | grep -q '^#!'; then + echo "ERROR: failed to fetch build script (HTTP $http_code). Response body:" + cat build-grav.sh + exit 1 + fi + echo "Fetched build script ($(wc -l < build-grav.sh) lines)" # Development Local URL # curl ${{ secrets.BUILD_SCRIPT_URL_18 }} --output build-grav.sh