Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/victoriadrake/link-snitch
:octocat: GitHub Action to scan your site for broken links so you can fix them 🔗
https://github.com/victoriadrake/link-snitch
actions broken-links continuous-integration continuous-testing github-actions security
Last synced: 3 months ago
JSON representation
:octocat: GitHub Action to scan your site for broken links so you can fix them 🔗
- Host: GitHub
- URL: https://github.com/victoriadrake/link-snitch
- Owner: victoriadrake
- License: mit
- Created: 2020-07-12T01:28:34.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-02T14:10:22.000Z (almost 3 years ago)
- Last Synced: 2024-10-12T00:46:33.554Z (3 months ago)
- Topics: actions, broken-links, continuous-integration, continuous-testing, github-actions, security
- Language: Shell
- Homepage:
- Size: 5.86 KB
- Stars: 58
- Watchers: 1
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- project-awesome - victoriadrake/link-snitch - :octocat: GitHub Action to scan your site for broken links so you can fix them 🔗 (Shell)
README
# Link Snitch: scan your site for broken links so you can fix them 🔗
A lightweight GitHub Action that runs [hydra-link-checker](https://github.com/victoriadrake/hydra-link-checker) on the URL you provide, which crawls your site and scans for broken links using multithreaded Python (standard library).
It's up to you to use Link Snitch responsibly!
## Contributing
This project simply Action-ifies (that's a word now, right?) the Hydra program. To submit issues or contributions to the link-checking functionality, go to [hydra-link-checker](https://github.com/victoriadrake/hydra-link-checker).
## Use this in your workflow
You can use this action in a workflow file to run Link Snitch on your choice of trigger, for instance, on a `push` event to the `master` branch:
```yml
push:
branches:
- master
```Or on a weekly schedule, say, 04:05 on Monday:
```yml
on:
schedule:
- cron: '5 4 * * 1'
```Here's a full example of a workflow file. See below for `env` instructions.
```yml
name: Link Snitchon:
push:
branches:
- masterenv:
URL: https://example.com
FILENAME: report.yaml
CONFIG: config.jsonjobs:
build:runs-on: ubuntu-latest
steps:
- name: Check out master
uses: actions/checkout@master
with:
fetch-depth: 1
- name: Report broken links
uses: victoriadrake/link-snitch@master
```### Setting the `env` variables
This action requires a single environment variable, `URL`. Set this to the fully qualified address of your site, including schema (the `https://` part).
Optional variables include:
- `FILENAME`: See [view results](#view-results) below.
- `CONFIG`: Your Hydra configuration file. See [Configuration for Hydra](https://github.com/victoriadrake/hydra-link-checker#configuration).### Workflow customization
See full instructions for [Configuring and managing workflows](https://help.github.com/en/actions/configuring-and-managing-workflows).
For help editing the YAML file, see [Workflow syntax for GitHub Actions](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions).
## View results
By default, the report is YAML formatted and output to `stdout` in your Action run. If you wish to save this to a file that you can download, set `FILENAME` to a file name of your choosing, then use `actions/upload-artifact` in your workflow. See [Uploading build and test artifacts](https://docs.github.com/en/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts#uploading-build-and-test-artifacts) for more.