INTEGRATION · GITHUB ACTION

Checkredirects.io GitHub Action

Check URLs for redirects, broken links, and errors as part of your CI/CD pipeline. Fail builds on problems, post results as PR comments.

GitHub API docs

Quick start

Add this to .github/workflows/check-redirects.yml:

name: Check Redirects
on: [push, pull_request]

permissions:
  contents: read
  pull-requests: write   # required for the PR comment

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: neondeerdatalabs/checkredirects-action@v1
        with:
          api-key: $${{ secrets.CHECKREDIRECTS_API_KEY }}
          urls: |
            https://example.com
            https://example.com/old-page

Inputs

InputDefaultDescription
api-key—Required. Your API key (starts with httpnd_).
urls—URLs to check, one per line. Provide exactly one of urls, urls-file, or sitemap.
urls-file—Path to a file with one URL per line (relative to the workspace).
sitemap—Sitemap URL. Parsed server-side, including sitemap indexes.
fail-on-errortrueFail if any URL has a 4xx/5xx final status or a connection error.
fail-on-redirectfalseFail if any URL redirects (one or more hops).
fail-on-chainfalseFail if any URL has two or more hops.
user-agent—Preset (e.g. googlebot) or a custom string.
max-redirects10Maximum redirects to follow per URL.
https-onlyfalseWhen true, don't fall back to HTTP if HTTPS fails.
share-resultsfalseCreate a public share link and include it in the PR comment. Off by default; results stay private.
comment-on-prtrueUpsert a single PR comment with the summary. No-op on push events.
dedupetrueRemove duplicate URLs before submission. Duplicates removed are reported in the summary.
timeout-seconds300Maximum wall-clock seconds to wait for the batch.
base-urlhttps://api.checkredirects.ioOverride for staging or self-hosted.

Outputs

OutputDescription
totalURLs submitted after dedupe.
completedURLs that returned a final status without a connection error.
errorsURLs with a 4xx/5xx final status or a connection error.
redirectsURLs that redirected (one or more hops).
chainsURLs with a redirect chain (two or more hops).
passtrue if no fail-on threshold was hit.
batch-idBatch job ID; use it to fetch full results from the API later.
share-urlPublic share URL (only set when share-results: true).
results-jsonPath under $RUNNER_TEMP to a JSON file with the full merged results.

PR comments

On pull request events the action upserts a single comment (one per PR, edited on later runs). It needs pull-requests: write permission. PRs from forks have a read-only token, so the action will write the summary to the step output and warn, but won't fail just because it couldn't comment.

Use cases

Add redirect checks to your CI pipeline

Free plan includes 250 checks per month. No credit card required.

Sign up