forked from music-encoding/music-encoding.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (75 loc) · 3.81 KB
/
link-checker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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:
args: |
--verbose --no-progress './**/*.md' './**/*.html' './**/*.rst' \
--exclude-mail \
--exclude-loopback \
--exclude-path /_includes \
--exclude-path /_layouts \
--exclude-path /_site \
--exclude-path /index.html \
--exclude-path /community/projects-users.md \
--exclude-path /conference/past.md \
--exclude-path /_conferences/2018 \
--exclude-path /_conferences/2019 \
--exclude-path /_conferences/2020 \
--exclude-path /_conferences/2021 \
--exclude-path /_conferences/2022 \
--exclude https://doi.org/10.13140/RG.2.2.15014.93760 \
--exclude https://doi.org/10.15463/music-1 \
--exclude https://arsmusicae.org \
--exclude https://www.conftool.net/music-encoding2022/* \
--exclude file:///Users/* \
--remap 'file:///home/runner/work/music-encoding.github.io/music-encoding.github.io/archive/ https://github.com/music-encoding/music-encoding.github.io/tree/gh-pages/archive/' \
--remap 'file:///file:///home/runner/work/music-encoding.github.io/music-encoding.github.io/_tutorials/ https://github.com/music-encoding/music-encoding.github.io/tree/gh-pages/tutorials' \
--remap 'file:///file:///home/runner/work/music-encoding.github.io/music-encoding.github.io/_tutorials-ES/ https://github.com/music-encoding/music-encoding.github.io/tree/gh-pages/tutorials-ES' \
--remap 'https://github.com/music-encoding/music-encoding/tree/basic https://github.com/music-encoding/music-encoding/commit/b50748ce537b43e1527791fb41e8c28aa1582cdb' \
--remap 'http://music-encoding.org/community/conference/tours17/program/ https://web.archive.org/web/20170511140944/http://music-encoding.org/community/conference/tours17/program' \
--remap 'http://music-encoding.org/community/mei-organization/mei-by-laws/ https://music-encoding.org/community/mei-by-laws.html' \
--remap 'http://music-encoding.org/proceedings https://github.com/music-encoding/mec-proceedings'
- 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