Skip to content

Commit

Permalink
build_loop.yml: handle the case where the dev branch reference is not…
Browse files Browse the repository at this point in the history
… found
  • Loading branch information
bjornoleh authored Mar 25, 2024
1 parent 6cfd758 commit de4761f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build_loop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit de4761f

Please sign in to comment.