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
28 changes: 20 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,17 @@ jobs:
echo "Fetching origin main..."
retry "git fetch origin main" git fetch origin main || exit 1
echo "Checking out $GITHUB_SHA..."
if git -c advice.detachedHead=false checkout -f "$GITHUB_SHA"; then
echo "::notice::Checkout successful: $(git log -1 --format='%h %ai %s')"
if ! git -c advice.detachedHead=false checkout -f "$GITHUB_SHA"; then
echo "::warning::Checkout failed, fetching SHA directly from origin..."
git fetch origin "$GITHUB_SHA" || true
if git -c advice.detachedHead=false checkout -f "$GITHUB_SHA"; then
echo "::notice::Checkout successful after direct fetch: $(git log -1 --format='%h %ai %s')"
else
echo "::error::GITHUB_SHA ($GITHUB_SHA) not found — checkout failed"
exit 1
fi
else
echo "::error::GITHUB_SHA ($GITHUB_SHA) not found in local repo — checkout failed"
exit 1
echo "::notice::Checkout successful: $(git log -1 --format='%h %ai %s')"
fi

- name: Install dependencies
Expand Down Expand Up @@ -152,11 +158,17 @@ jobs:
echo "Fetching origin main..."
retry "git fetch origin main" git fetch origin main || exit 1
echo "Checking out $GITHUB_SHA..."
if git -c advice.detachedHead=false checkout -f "$GITHUB_SHA"; then
echo "::notice::Checkout successful: $(git log -1 --format='%h %ai %s')"
if ! git -c advice.detachedHead=false checkout -f "$GITHUB_SHA"; then
echo "::warning::Checkout failed, fetching SHA directly from origin..."
git fetch origin "$GITHUB_SHA" || true
if git -c advice.detachedHead=false checkout -f "$GITHUB_SHA"; then
echo "::notice::Checkout successful after direct fetch: $(git log -1 --format='%h %ai %s')"
else
echo "::error::GITHUB_SHA ($GITHUB_SHA) not found — checkout failed"
exit 1
fi
else
echo "::error::GITHUB_SHA ($GITHUB_SHA) not found in local repo — checkout failed"
exit 1
echo "::notice::Checkout successful: $(git log -1 --format='%h %ai %s')"
fi

- name: Install dependencies
Expand Down
Loading