DOCS › CITELOG › GITHUB ACTION SETUP

GitHub Action setup

AI answer readiness on every pull request: one comment with what to fix, edited on each push, and the full report in the job summary.

CITELOG 0.1.0 · RUNS ON NODE24

Check every pull request

Add this workflow. It builds your site, then checks the pages the pull request changes.

.github/workflows/citelog.yml
name: Citelog
on: pull_request            # never pull_request_target with a checkout of PR code
permissions:
  contents: read
  pull-requests: write      # add issues: write if the comment step gets HTTP 403
jobs:
  citelog:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - run: npm ci && npm run build
      - uses: kunoluapps/citelog@v0
        with:
          path: ./dist                 # or url: your preview deployment of this branch
          # base-url: https://yoursite.com   # optional: compare with the live site
          fail-under: 75               # optional: fail the job below this score

On a pull request the Action:

  • Checks the pages this pull request changes (matched from the changed files; every page up to max-pages when they don't map to pages), on the preview url or else the built HTML in path.
  • Posts one comment and edits it on later pushes: the score, new failures first, the fixes, and what changed since the last push.
  • Writes the full report to the job summary.
  • Never asks prompts in pull requests.
  • Fails the job when fail-under is missed, and names the checks. With neither url nor path, it fails and says the two ways to fix it.

Pull requests from forks get the job summary only.

A fork's token is read-only and secrets aren't passed, so Citelog skips the comment and prompts, says why in the summary, and doesn't fail for missing permissions. A 403 or 404 on the comment is treated the same way.

Weekly run and badge

A scheduled run checks the live site, can ask your prompts, and writes a README badge. Committing the badge is the workflow's job; there is no hosted badge service.

.github/workflows/citelog-weekly.yml
name: Citelog weekly
on:
  schedule: [{ cron: '0 7 * * 1' }]
  workflow_dispatch:
permissions:
  contents: write          # to commit the badge
jobs:
  citelog:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - id: citelog
        uses: kunoluapps/citelog@v0
        with:
          url: https://yoursite.com
          badge: .github/citelog-badge.svg
          prompts: true                     # asks the prompts in citelog.config.json
          # perception: true                # also judge answers that name or cite you (OpenAI or Anthropic key)
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
      - name: Commit the badge
        run: |
          git config user.name "github-actions[bot]"
          git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
          git add .github/citelog-badge.svg README.md
          git diff --cached --quiet || git commit -m "Update Citelog badge" && git push

Put the badge in your README. The line between the markers is rewritten on each run:

README.md
[![Citelog](.github/citelog-badge.svg)](https://yoursite.com)
<!-- citelog:badge-line -->AI answer readiness of yoursite.com<!-- /citelog:badge-line -->

The badge shows the score and its band: 90–100 ready, 50–89 needs work, 0–49 not ready, or "no score" when the last check couldn't run.

Inputs

Input Default What it does
url Preview URL on a pull request; the live site or a sitemap URL on a schedule
path Folder of built HTML (for example ./dist)
base-url Live site, to compare changed pages with the default branch
max-pages 50 Pages to read from a sitemap or folder
fail-under Fail the job below this score (0–100)
prompts false Ask the prompts in citelog.config.json (scheduled runs only)
perception false With prompts, judge each answer that names or cites the site as positive, neutral or negative, on the OpenAI or Anthropic key in env (a small model; about $0.00014 an answer). Off by default so CI has no judge cost
logs Access log to read for AI crawler visits (scheduled runs)
github-token github.token Token for the pull request comment
badge Path to write the badge SVG on scheduled and default-branch runs
comment true Post and keep editing one pull request comment

Outputs: score, band, report-json, report-md, badge-line, comment-url.

Privacy

No telemetry. The Action calls only the site it checks, the engines whose keys you pass, and the GitHub API for the comment.