Link Checker #156
Workflow file for this run
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: | |
schedule: | |
- cron: "0 13 * * 0" # run every Sunday at 1pm UTC https://crontab.guru/#0_13_*_*_1 | |
workflow_dispatch: # trigger manually | |
inputs: | |
branch: | |
description: "Branch to check" | |
required: true | |
default: main | |
# globals | |
env: | |
CHECK_WEBSITE: https://music-encoding.org | |
CHECK_OWNER: music-encoding | |
CHECK_BRANCH: main | |
jobs: | |
website_link_check: | |
name: Check website links | |
runs-on: ubuntu-latest | |
if: ${{ github.repository_owner == 'music-encoding' }} | |
steps: | |
- uses: technote-space/broken-link-checker-action@b8332d945b97f8b52eb8d7d889a1e0e37106c1a9 # ratchet:technote-space/broken-link-checker-action@v2 | |
with: | |
target: ${{ env.CHECK_WEBSITE }} | |
linkChecker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set variables | |
run: | | |
if [[ "${{ github.event.inputs.branch }}" != '' ]] ; then | |
echo "Setting branch: ${{ github.event.inputs.branch }}" | |
echo "CHECK_BRANCH=${{ github.event.inputs.branch }}" >> $GITHUB_ENV | |
fi | |
- name: Checkout main repo | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.CHECK_BRANCH }} | |
- name: Link Checker | |
id: lychee | |
uses: lycheeverse/lychee-action@c053181aa0c3d17606addfe97a9075a32723548a # ratchet:lycheeverse/[email protected] | |
with: | |
debug: true | |
- name: Create Issue From File | |
if: env.lychee_exit_code != 0 | |
uses: peter-evans/create-issue-from-file@24452a72d85239eacf1468b0f1982a9f3fec4c94 # ratchet:peter-evans/create-issue-from-file@v4 | |
with: | |
title: Link Checker Report | |
content-filepath: ./lychee/out.md | |
labels: bug, documentation |