https://github.com/svanboxel/link-checker
A GitHub action for link checking repository Markdown and HTML files
https://github.com/svanboxel/link-checker
Last synced: about 1 month ago
JSON representation
A GitHub action for link checking repository Markdown and HTML files
- Host: GitHub
- URL: https://github.com/svanboxel/link-checker
- Owner: SvanBoxel
- License: mit
- Created: 2019-12-10T09:09:20.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-10T09:38:27.000Z (over 6 years ago)
- Last Synced: 2025-07-30T03:59:43.574Z (10 months ago)
- Language: Shell
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Link Checker
[](https://github.com/marketplace/actions/link-checker)
A GitHub action for link checking repository Markdown and HTML files.
When used in conjunction with [Create Issue From File](https://github.com/peter-evans/create-issue-from-file), issues will be created when Link Checker finds connectivity problems with links.
## Usage
Link Checker uses [Liche](https://github.com/raviqqe/liche).
Liche arguments should be passed to the action via the `args` parameter.
This example will check all markdown and HTML files in your repository.
```yml
- name: Link Checker
uses: peter-evans/link-checker@v1
with:
args: -v -r *
```
See [Liche's documentation](https://github.com/raviqqe/liche) for further argument details.
#### Optional environment variables
If Link Checker finds connectivity problems with links the action will output a markdown file containing the error report.
The default path is `link-checker/out.md`. The path and filename may be overridden with the following variables.
- `LINKCHECKER_OUTPUT_DIR` - The output directory the markdown error report
- `LINKCHECKER_OUTPUT_FILENAME` - The error report filename
#### Receiving issues containing the error report
Below is an example of using this action in conjunction with [Create Issue From File](https://github.com/peter-evans/create-issue-from-file). The workflow executes on a schedule every month. Issues will be created when Link Checker finds connectivity problems with links.
```yml
on:
schedules:
- cron: 0 0 1 * *
name: Check markdown links
jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Link Checker
uses: peter-evans/link-checker@v1
with:
args: -v -r *
- name: Create Issue From File
uses: peter-evans/create-issue-from-file@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_TITLE: Link Checker Report
ISSUE_CONTENT_FILEPATH: ./link-checker/out.md
ISSUE_LABELS: report, automated issue
```
## Issue sample
[This link](https://aoushaoueshosuhoshuoeu.com) is intentionally non-existent.
The workflow in this repository generated [this sample issue](https://github.com/peter-evans/link-checker/issues/1).
## License
MIT License - see the [LICENSE](LICENSE) file for details