Check Broken Links #64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check Broken Links | |
on: | |
schedule: | |
- cron: '0 10 1,15 * *' # Run on 1st and 15th days of every month at 10:00 UTC | |
workflow_dispatch: # Allow manual triggering of the workflow | |
jobs: | |
check_links: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Close Existing Broken Links Issue(s) | |
uses: actions/stale@v9 | |
with: | |
repo-token: ${{ secrets.GH_PAT }} | |
# Broken link issues are automatically created with the "automated issue" and "Broken links" labels, so we only care about closing those. | |
only-issue-labels: automated issue,Broken links | |
ignore-issue-updates: true | |
# close-issue-message requires permission `issues: write` | |
close-issue-message: 'This issue is `stale` and has been closed due to a new "Check Broken Links" run. If any links are still broken, they will be reported in a new issue: https://github.com/quicksilver-zone/quicksilver/issues?q=is%3Aissue+is%3Aopen+label%3A%22automated+issue%22+label%3A%22Broken+links%22' | |
days-before-issue-stale: 0 | |
days-before-issue-close: 0 | |
- name: Link Checker | |
id: lychee | |
uses: lycheeverse/[email protected] | |
with: | |
args: --exclude-loopback --verbose --no-progress './**/*.md' './**/*.html' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
- name: Create Issue From File | |
if: env.lychee_exit_code != 0 | |
uses: peter-evans/create-issue-from-file@v5 | |
with: | |
title: Broken Links Detected | |
content-filepath: ./lychee/out.md | |
labels: report, automated issue, Good first issue, Help wanted, Broken links |