diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index 66f3bf643..134d89ae8 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -72,10 +72,15 @@ jobs: SHA=$(curl -sS \ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ https://api.github.com/repos/${{ env.UPSTREAM_REPO }}/git/refs \ - | jq -r '.[] | select(.ref == "refs/heads/dev" ) | .object.sha' \ + | jq -r '.[] | select(.ref == "refs/heads/dev" ) | .object.sha // empty' \ | tr -d '"' ); - + + if [ -z "$SHA" ]; then + echo "Error: SHA for 'dev' branch not found."; + exit 1; + fi + # Create alive branch based on LoopKit/LoopWorkspace:dev gh api \ --method POST \