Site Health Check #555
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Site Health Check | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 3,20 * * *' | |
permissions: | |
issues: write | |
jobs: | |
check_website: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check Website Status | |
id: check_website_status # Added an ID to this step to reference its outputs later | |
run: | | |
status_code=$(curl -s -o /dev/null -w "%{http_code}" https://livedemo.spreadsheet-importer.com/launchpad.html#Shell-home) | |
echo "STATUS_CODE=$status_code" | |
if [ "$status_code" -ne 200 ]; then | |
echo "create_issue=true" >> $GITHUB_ENV | |
fi | |
- name: Create or Comment on Issue | |
if: env.create_issue == 'true' # Changed to check an environment variable | |
uses: peter-evans/create-issue-from-file@v5 | |
with: | |
title: Website Down! | |
content-filepath: .github/livedemodown-template.md | |
token: ${{ secrets.GITHUB_TOKEN }} |