Skip to content

Commit

Permalink
fix: Default branch resolution when running E2E tests (#12910)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimblanc authored Jan 27, 2024
1 parent 278776f commit b473532
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/actions/setup-samples-staging/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ runs:
env:
BRANCH: ${{ github.ref_name }}
run: |
if git ls-remote origin $BRANCH | grep -q refs/heads/next/$BRANCH$; then
# Branch exists, checkout and echo success message
if git ls-remote --exit-code --heads origin refs/heads/$BRANCH; then
# Corresponding branch on sample repo exists, check it out
git fetch origin $BRANCH
git checkout $BRANCH
echo "Checked out branch: $BRANCH"
else
# Branch doesn't exist, echo error message
# Corresponding branch doesn't exist, default to main
echo "Branch '$BRANCH' does not exist"
fi
Expand Down

0 comments on commit b473532

Please sign in to comment.