Skip to content

Commit

Permalink
chore: pr-release.yaml: fetch nightly-with-mathlib sha using ls-remote
Browse files Browse the repository at this point in the history
this refines upon #3834, which didn’t quite work, and was producing
```
 From https://github.com/leanprover/lean4
 * branch                  nightly-with-mathlib -> FETCH_HEAD
 * [new branch]            nightly-with-mathlib -> origin/nightly-with-mathlib
fatal: ambiguous argument 'nightly-with-mathlib': unknown revision or path not in the working tree.
```
Probably `git -C lean4.git fetch origin nightly-with-mathlib:nightly-with-mathlib`
would have worked, or using `rev-parse origin/nightly-with-mathlib`.

We now get the commit hash via `git ls-remote`, which I’d wager is a bit
more robust, as it is independent of the local state.
  • Loading branch information
nomeata committed Apr 15, 2024
1 parent 6712913 commit 679ba45
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/pr-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
MESSAGE=""
if [[ -n "$MATHLIB_REMOTE_TAGS" ]]; then
echo "... and Mathlib has a 'nightly-testing-$MOST_RECENT_NIGHTLY' tag."
echo "... and Mathlib has a 'nightly-testing-$MOST_RECENT_NIGHTLY' tag."
else
echo "... but Mathlib does not yet have a 'nightly-testing-$MOST_RECENT_NIGHTLY' tag."
MESSAGE="- ❗ Mathlib CI can not be attempted yet, as the \`nightly-testing-$MOST_RECENT_NIGHTLY\` tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto \`nightly-with-mathlib\`, Mathlib CI should run now."
Expand All @@ -149,8 +149,7 @@ jobs:
echo "but 'git merge-base origin/master HEAD' reported: $MERGE_BASE_SHA"
git -C lean4.git log -10 origin/master
git -C lean4.git fetch origin nightly-with-mathlib
NIGHTLY_WITH_MATHLIB_SHA="$(git -C lean4.git rev-parse "nightly-with-mathlib")"
NIGHTLY_WITH_MATHLIB_SHA="$(git ls-remote https://github.com/leanprover/lean4.git nightly-with-mathlib|cut -f 1)"
MESSAGE="- ❗ Std/Mathlib CI will not be attempted unless your PR branches off the \`nightly-with-mathlib\` branch. Try \`git rebase $MERGE_BASE_SHA --onto $NIGHTLY_WITH_MATHLIB_SHA\`."
fi
Expand Down

0 comments on commit 679ba45

Please sign in to comment.