Prompt to schedule a GitHub Action that checks a live site before you re-export

Short answer

This prompt asks an AI assistant to write a scheduled GitHub Action that fetches your live source site, compares it with a committed fingerprint, and opens an issue when pages changed. WebExport exports run from its web form, so the Action tells you when to re-export. Your host redeploys when you commit the new files.

Last reviewed

Key facts

  • A WebExport export is started from the web form, so a workflow cannot start one. The Action watches the source site and prompts a person.
  • GitHub schedules use POSIX cron in UTC, run on the default branch and run at most every 5 minutes.
  • In a public repository, scheduled workflows are disabled after 60 days without repository activity, according to GitHub Docs.
  • Test status: not run on GitHub. The two commands the workflow uses (the inventory script and the parity script with --hash) were run locally against webexport.online and behaved as described. The workflow file itself was not executed, so test it with a manual run before you rely on it.

The prompt

Paste this into Claude Code, Cursor, Codex or another AI coding assistant with your project folder open, and replace everything in square brackets first. See how to run it in each tool.

Write the scheduled check
You are adding a scheduled check to this repository. The live source site is [SOURCE_URL]. The exported copy that we deploy is committed in [EXPORT_DIR: site]. Our host redeploys from the [BRANCH: main] branch on every push.

STEP 1: SCRIPTS
Make sure scripts/inventory.mjs (writes a CSV of the pages of a site, with a hash of each page's text) and scripts/parity.mjs (compares two such CSV files and exits with code 1 when they differ) exist. If not, write them in Node 22 with no dependencies.

STEP 2: BASELINE
Run the inventory script on [SOURCE_URL] and commit the result as fingerprint.csv.

STEP 3: WORKFLOW
Write .github/workflows/source-check.yml:
- Triggers: a weekly schedule at [CRON: 17 5 * * 1] and a manual workflow_dispatch.
- Permissions: contents read and issues write, nothing else.
- Steps: check out, set up Node 22, run the inventory script on the source site into current.csv, run the parity script with the --hash flag and save its output to report.md.
- If the parity script exits with 1, open an issue titled "Source site changed: re-export needed" with report.md as the body. If it exits with any other non-zero code, fail the job. If it exits with 0, do nothing.
- Use only actions you can pin to a major version. Do not use any third-party action that you cannot explain.

STEP 4: EXPLAIN
Write SOURCE-CHECK.md with: how to re-export when an issue appears, how to refresh fingerprint.csv after you commit new export files, and the 60-day inactivity rule for scheduled workflows.

RULES
- Do not add any secret, token or API key to a file. The workflow needs none.
- Do not change [EXPORT_DIR] or any exported file.
- Do not add a deploy step. The host already deploys on push.
- Tell me if the hash check is too noisy on this site, for example because pages print a date.

How to run it

  1. Decide how often a check is useful. Weekly suits most sites, and a daily run adds noise.
  2. Run the prompt, review the workflow file, and push it to a branch.
  3. Run the workflow by hand from the Actions tab once and read the output.
  4. When an issue opens, export the site again with WebExport, replace the files in the export folder, refresh the fingerprint and push.

A workflow to start from

This is the shape the prompt should produce. The github-script action opens the issue with the job's own token, so no secret is stored. Check the action versions against GitHub's current documentation before you use it.

.github/workflows/source-check.yml
name: Check source site
on:
  schedule:
    - cron: '17 5 * * 1'
  workflow_dispatch:
permissions:
  contents: read
  issues: write
jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - name: Fingerprint the live source site
        env:
          SOURCE_URL: https://old-site.example.com
        run: node scripts/inventory.mjs "$SOURCE_URL" 200 > current.csv
      - name: Compare with the committed fingerprint
        id: diff
        run: |
          set +e
          node scripts/parity.mjs fingerprint.csv current.csv --hash > report.md
          echo "code=$?" >> "$GITHUB_OUTPUT"
      - name: Fail on a script error
        if: steps.diff.outputs.code != '0' && steps.diff.outputs.code != '1'
        run: exit 1
      - name: Open an issue when pages changed
        if: steps.diff.outputs.code == '1'
        uses: actions/github-script@v7
        with:
          script: |
            const body = require('fs').readFileSync('report.md', 'utf8').slice(0, 60000);
            await github.rest.issues.create({ ...context.repo, title: 'Source site changed: re-export needed', body });

The two scripts are on the inventory prompt page and the parity prompt page.

Where the host fits

Most static hosts redeploy when you push to the connected branch, so the workflow does not need a deploy step. If your host is not connected to Git, take the deploy command from the host guide, for example the Vercel, Netlify or Cloudflare Pages pages. Keep any deploy token in the repository's secrets, never in the workflow file.

QuestionAnswer from GitHub DocsSource
Which time zone?UTC by default, with an optional IANA time zoneSchedule event docs
Which branch runs?The latest commit on the default branchSame page
How often at most?Once every 5 minutesSame page
When does it stop?In a public repository, after 60 days without activitySame page and enabling a workflow

Verify the result

Run the workflow by hand, then break the fingerprint on purpose to see the issue appear.

terminal
node scripts/inventory.mjs https://old-site.example.com 200 > current.csv
node scripts/parity.mjs fingerprint.csv current.csv --hash > report.md; echo "exit code: $?"
sed -i.bak 's/^"\/","200"/"\/","201"/' fingerprint.csv
node scripts/parity.mjs fingerprint.csv current.csv --hash > /dev/null; echo "exit code after edit: $?"
git checkout fingerprint.csv && rm fingerprint.csv.bak
  • The first run exits with 0 on an unchanged site, and the manual workflow run finishes green with no issue.
  • After the edit, the exit code is 1, and the workflow opens one issue with the report as its body.
  • The workflow file contains no token, key or password.

What can go wrong

  • Pages that print a date or a rotating block change the text hash on every run and open an issue each week. If that happens, compare titles and word counts only.
  • A workflow that has not run for 60 days in a public repository is switched off. Push something or enable it again.
  • The check sees the public site. A change behind a login or in a form handler never shows up.

Frequently asked questions

Can a workflow re-export the site for me?

Not through WebExport as described on this site. Exports start from the web form, so the Action tells you when the source changed and you start the export.

Why not deploy from the Action?

Most static hosts already deploy when you push. Adding a deploy step duplicates that and needs a token. Skip it unless your host has no Git connection.

Will it run exactly on time?

Not always. GitHub notes that schedules can be delayed at busy times, so treat the hour as approximate.

Can I run it daily?

You can, down to every 5 minutes. For a site that changes weekly, a weekly check is plenty and keeps issues meaningful.

Official documentation

Free tools for this job

Start with the files

Prompts work best on a WebExport download of your site. Paste your public URL into the export form and get a ZIP. The Free plan covers 1 site, 5 exports a month, 15 pages and 20 MB per export. Professional is a $9.99 one-time purchase with unlimited pages.