Skip to content

Commit a63497c

Browse files
authored
fixes #322 check for null (#336)
* fixes #322 check for null fixes #322 ig the main issue was an api issue checking for null should work fine otherwise we can add semver validation via regex * chore: added better errors and comments
1 parent b40e218 commit a63497c

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/lychee-version.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,19 @@ jobs:
2424
id: get-lychee-release
2525
run: |
2626
echo "Fetching the latest lychee release version..."
27-
release=$(curl -s https://api.github.com/repos/lycheeverse/lychee/releases/latest | jq -r .tag_name)
28-
release=${release#lychee-} # Strip the 'lychee-' prefix
27+
release=$(curl -sSf https://api.github.com/repos/lycheeverse/lychee/releases/latest | jq -r .tag_name)
28+
release=${release#lychee-} # Strip the 'lychee-' prefix
29+
30+
# Exit if the release version is empty or invalid
31+
if [ -z "$release" ] || [ "$release" == "null" ]; then
32+
echo "::error::Failed to fetch the latest lychee release."
33+
echo "::group::Troubleshooting Steps"
34+
echo "1. Check GitHub API status. (https://www.githubstatus.com/)"
35+
echo "2. Manual verification: https://github.com/lycheeverse/lychee/releases"
36+
echo "::endgroup::"
37+
exit 1
38+
fi
39+
2940
echo "Latest release version fetched: $release"
3041
echo "release_version=$release" >> $GITHUB_OUTPUT
3142

0 commit comments

Comments
 (0)