Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/link-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Check Links

Comment thread
BNAndras marked this conversation as resolved.
on:
workflow_call:

jobs:
linkChecker:
if: github.repository_owner == 'exercism'
runs-on: ubuntu-26.04
permissions:
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411
with:
args: --cache --accept ..=299,429 --suggest --verbose --require-https --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36" --no-progress **/*.md **/*.html **/*.toml **/*.json
fail: false

- name: Create Issue From File
if: steps.lychee.outputs.exit_code != 0
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6.0.0
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,5 +343,31 @@ jobs:
ordering: ".bucket, .slug"
```

## Reusable workflow: link-checker

The `link-checker` reusable workflow calls [Lychee][lychee] and creates an issue if any problematic links are reported.

### Inputs

None.

### Example

To run this on a monthly schedule, in your track repo add this workflow:

```yaml
name: Check Links

on:
workflow_dispatch:
schedule:
- cron: 0 0 15 * * # 15th day of each month

jobs:
call-gha-workflow:
uses: exercism/github-actions/.github/workflow/link-checker.yml@main
```

[configlet]: https://exercism.org/docs/building/configlet
[configlet-lint]: https://exercism.org/docs/building/configlet/lint
[lychee]: https://github.com/lycheeverse/lychee#readme