Skip to content

Commit

Permalink
Update action for error
Browse files Browse the repository at this point in the history
  • Loading branch information
ia3andy committed Dec 11, 2024
1 parent 083b23c commit 40f8e34
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,14 @@ runs:
GITHUB_TOKEN: ${{ inputs.github-token }}
run: |
# Fetch GitHub Pages URL
url=$(gh api "repos/$GITHUB_REPOSITORY/pages" --jq '.html_url' || '')
# Fetch GitHub Pages URL
url=$(gh api "repos/$GITHUB_REPOSITORY/pages" --jq '.html_url' 2>/dev/null || echo '')
# Check if URL is non-empty (i.e., GitHub Pages is enabled)
if [[ -z "$url" ]]; then
if [ -n "$url" ]; then
echo "GitHub Pages is enabled for this repository: $url"
echo "SITE_FULL_URL=$url" >> $GITHUB_ENV
else
echo "Error: GitHub Pages is not enabled for this repository."
echo "To enable GitHub Pages:"
echo "1. Go to 'Settings' > 'Pages' in your repository."
echo "2. Configure the branch and folder for GitHub Pages."
echo "::error::GitHub Pages is not enabled for this repository. To enable GitHub Pages: Go to 'Settings' > 'Pages' in your repository and configure GitHub Pages."
exit 1
fi
Expand Down

0 comments on commit 40f8e34

Please sign in to comment.