Skip to content
Closed
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
15 changes: 14 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,20 @@ runs:
VARIANT="Linux-x86_64"

# Find download URL for the Linux build
URL=$(curl --retry 5 -sL "https://api.github.com/repos/FStarLang/FStar/releases/tags/$FSTAR" | jq '.assets.[] | .browser_download_url | select(contains("Linux"))' -r)
if [[ -z "$GH_TOKEN" || ! $(command -v gh) ]]; then
echo -e "\033[0;31mWARNING: fallback from [gh] to [curl]. You may hit API rate limits.\033[0m"
if [[ ! $(command -v gh) ]]; then
echo -e "\033[0;31m Command [gh] not found.\033[0m"
fi
if [[ -z "$GH_TOKEN" ]]; then
echo -e "\033[0;31m [GH_TOKEN] is not set.\033[0m"
echo -e "\033[0;31m To use GitHub CLI in a GitHub Actions workflow, set the GH_TOKEN environment variable.:\033[0m"
fi
ASSETS=$(gh release view "$FSTAR" --repo FStarLang/FStar --json assets)
else
ASSETS=$(curl --retry 5 -sL "https://api.github.com/repos/FStarLang/FStar/releases/tags/$FSTAR")
fi
URL=$(echo "$ASSETS" | jq '.assets.[] | (.url // .browser_download_url) | select(contains("Linux"))' -r)
# Download
echo "Trying to download $URL"
curl -sL "$URL" -o fstar.tar.gz
Expand Down
Loading