Skip to content

Commit

Permalink
[ ci ] re 3067: fix CI on main branch
Browse files Browse the repository at this point in the history
The extra CI jobs introduced in idris-lang#3067 work fine as long as 'main' is not
the checked out branch. This is due to the fetch to a new branch, which
git does (reasonably) not allow when you're trying to fetch 'main' into
a new branch that's also called 'main'. In this case, we should just
`git pull origin main`, which is what the script now (hopefully) does.
  • Loading branch information
CodingCellist committed Sep 15, 2023
1 parent 0029257 commit 43a5479
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/ci-idris2-and-libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,14 @@ jobs:
- name: Build idris2-pack
run: |
git config --global --add safe.directory "${PWD}"
git fetch "https://github.com/${GITHUB_REPOSITORY}" "${GITHUB_REF}:${GITHUB_REF_NAME}"
# only fetch to a new branch if we're not on main (otherwise, git complains)
if [[ $(git branch --show-current) != 'main' ]]
then git fetch "https://github.com/${GITHUB_REPOSITORY}" "${GITHUB_REF}:${GITHUB_REF_NAME}"
else git pull origin main
fi
# rebuild pack with the fetched Idris2
pack install pack
######################################################################
Expand Down Expand Up @@ -663,7 +670,13 @@ jobs:
- name: Build pack with PR-Idris
run: |
git config --global --add safe.directory "${PWD}"
git fetch "https://github.com/${GITHUB_REPOSITORY}" "${GITHUB_REF}:${GITHUB_REF_NAME}"
# only fetch to a new branch if we're not on main (otherwise, git complains)
if [[ $(git branch --show-current) != 'main' ]]
then git fetch "https://github.com/${GITHUB_REPOSITORY}" "${GITHUB_REF}:${GITHUB_REF_NAME}"
else git pull origin main
fi
pack install pack
- name: Build+install idris2-lsp
run: |
Expand Down

0 comments on commit 43a5479

Please sign in to comment.