Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.3 backport] Fix GHA when opam-rt uses a diverging API #6337

Merged
merged 1 commit into from
Dec 12, 2024
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
20 changes: 11 additions & 9 deletions .github/scripts/main/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,18 @@ if [ "$OPAM_TEST" = "1" ]; then
fi
cd $CACHE/opam-rt
git fetch origin
if git ls-remote --exit-code origin $BRANCH ; then
if git branch | grep -q $BRANCH; then
git checkout $BRANCH
git reset --hard origin/$BRANCH
else
git checkout -b $BRANCH origin/$BRANCH
fi
if git ls-remote --exit-code origin "$BRANCH"; then
OPAM_RT_BRANCH=$BRANCH
elif [ "$GITHUB_EVENT_NAME" = pull_request ] && git ls-remote --exit-code origin "$GITHUB_BASE_REF"; then
OPAM_RT_BRANCH=$GITHUB_BASE_REF
else
OPAM_RT_BRANCH=master
fi
if git branch | grep -q "$OPAM_RT_BRANCH"; then
git checkout "$OPAM_RT_BRANCH"
git reset --hard "origin/$OPAM_RT_BRANCH"
else
git checkout master
git reset --hard origin/master
git checkout -b "$OPAM_RT_BRANCH" "origin/$OPAM_RT_BRANCH"
fi

test -d _opam || opam switch create . --no-install --formula '"ocaml-system"'
Expand Down
Loading