Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions .github/actions/checkout-eyrie/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,19 @@ runs:
echo "$repo already present at $dest"
continue
fi
ref="${{ inputs.ref }}"
# Fall back to main if the branch doesn't exist on the dependency repo.
if ! git ls-remote --heads "https://github.com/GrayCodeAI/${repo}.git" "$ref" | grep -q .; then
echo "Branch '$ref' not found on $repo, falling back to main"
ref="main"
commit=$(git ls-tree HEAD "external/${repo}" | awk '{print $3}' || true)
if [ -n "$commit" ]; then
echo "Cloning $repo at submodule commit $commit"
git clone --depth=1 "https://github.com/GrayCodeAI/${repo}.git" "$dest"
(cd "$dest" && git checkout --quiet "$commit")
else
ref="${{ inputs.ref }}"
# Fall back to main if the branch doesn't exist on the dependency repo.
if ! git ls-remote --heads "https://github.com/GrayCodeAI/${repo}.git" "$ref" | grep -q .; then
echo "Branch '$ref' not found on $repo, falling back to main"
ref="main"
fi
git clone --depth=1 --branch "$ref" \
"https://github.com/GrayCodeAI/${repo}.git" "$dest"
fi
git clone --depth=1 --branch "$ref" \
"https://github.com/GrayCodeAI/${repo}.git" "$dest"
done
Loading