Nothing makes a website seem more defunct than a bunch of dead links. That said, when you are moving fast, it can be a headache to keep on top of changes, and downright impossible to stay on top of links to external sites that end up restructuring. There are already great tools out there to solve this problem, and this uses one of them (linkchecker) to run checks via GitHub Actions in a simple and easy to customize way.
To use the link checker, simply call the action with the domain you want to check. Check out this example usage in my repo documenting GitHub Actions.
- name: Check Links
uses: DAKLabb/check-links@main
with:
url: myURL.tld| Input | Required | Description |
|---|---|---|
| url | X | The url of the site to check |
| site-name | The name of the site being checked | |
| report-name | The name of the report as displayed in GitHub | |
| check-external | Whether to check external links | |
| include-warnings | Whether to include warnings | |
| debug-config | Logs the contents of the linkchecker config for verification |
If the checker finds bad links, a report will be uploaded as an artifact to the GH action run. Additionally, the details of the bad links should show up as errors from the run.