Link Checker #249
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: Link Checker | |
on: | |
repository_dispatch: | |
workflow_dispatch: | |
schedule: | |
- cron: "00 18 * * *" | |
jobs: | |
linkChecker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: ⤵️ Check out code from GitHub | |
uses: actions/checkout@v4 | |
- name: 🔍 Run lychee | |
uses: lycheeverse/lychee-action@v2 | |
id: lychee | |
- name: 🔗 Find Link Checker Issue | |
id: link-checker-issue | |
uses: micalevisk/last-issue-action@v2 | |
with: | |
state: open | |
labels: | | |
link-checker | |
- name: 📝 Create Issue From File | |
if: env.lychee_exit_code != 0 | |
uses: peter-evans/create-issue-from-file@v5 | |
with: | |
title: Link Checker Report | |
content-filepath: ./lychee/out.md | |
issue-number: "${{ steps.link-checker-issue.outputs.issue-number }}" | |
labels: link-checker | |
- name: 🗑️ Close old issue | |
if: ${{ env.lychee_exit_code == 0 && steps.last-issue.outputs.has-found == 'true' && steps.last-issue.outputs.is-closed == 'false' }} | |
uses: peter-evans/close-issue@v3 | |
with: | |
issue-number: "${{ steps.link-checker-issue.outputs.issue-number }}" | |
comment: "All links are working as expected." |