Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/harrisonpim/broken-link-checker
🔗 a github action to periodically check a site for broken links
https://github.com/harrisonpim/broken-link-checker
actions broken-links github-actions seo sitemap
Last synced: about 2 months ago
JSON representation
🔗 a github action to periodically check a site for broken links
- Host: GitHub
- URL: https://github.com/harrisonpim/broken-link-checker
- Owner: harrisonpim
- Created: 2022-01-27T22:24:27.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-28T19:13:44.000Z (almost 3 years ago)
- Last Synced: 2024-11-17T15:51:03.222Z (about 2 months ago)
- Topics: actions, broken-links, github-actions, seo, sitemap
- Language: TypeScript
- Homepage:
- Size: 2.55 MB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing.md
- Code of conduct: docs/code_of_conduct.md
Awesome Lists containing this project
- project-awesome - harrisonpim/broken-link-checker - 🔗 a github action to periodically check a site for broken links (TypeScript)
README
# 🔗 Broken link checker
This action takes a sitemap as input, and checks each of its URLs for broken links.
## Inputs
- `sitemap`: **Required** The URL of the sitemap to crawl.
- `allowList`: **Optional** A list of URLs to ignore. Should be formatted as a JSON array, eg `["https://example.com/", "https://example.com/blog"]`.## Outputs
If no broken links are found, the action passes silently. If any links are broken, the action will fail with:
- `broken-links`: A list of broken links, with the page where they were found.
## Example usage
Copy the following into a file called `.github/workflows/broken-links.yml` in your repo, and remember to edit the `sitemap` input to point to your own sitemap.
```yaml
name: Check site for broken links
on:
schedule:
- cron: "0 0 * * 0"
# Runs every Sunday at midnight
# see https://crontab.guru/#0_0_*_*_0
jobs:
check-site-for-broken-links:
runs-on: ubuntu-latest
steps:
- uses: harrisonpim/[email protected]
with:
sitemap: https://harrisonpim.com/sitemap.xml
```## Further information
See the [broken-link-checker documentation](./docs/) for more information.