-
Notifications
You must be signed in to change notification settings - Fork 10
70 lines (60 loc) · 1.87 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
name: Link Checker
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
schedule:
- cron: "00 18 * * *"
jobs:
linkChecker:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true
cache-version: 0
- name: Install dependencies
run: |
bundle install
- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: |
bundle exec jekyll build
env:
PAGES_REPO_NWO: ${{ github.repository }}
JEKYLL_BUILD_BRANCH: ${{ github.ref_name }}
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v2
with:
# Check all markdown, html and reStructuredText files in repo (default)
args: _site/ --fallback-extensions html --github-token ${{ secrets.GITHUB_TOKEN }}
# Don't fail action on broken links
fail: false
- name: Add page URL
run: |
DEPLOY_URL="https://plan.research-data.no/pages/" && \
sed -i "s|\\#\\#\\# Errors in _site\/|\\#\\#\\# Errors in ${DEPLOY_URL}|g" ./lychee/out.md && \
cat ./lychee/out.md
- name: Create Issue From File
if: steps.lychee.outputs.exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue
issue-number: 166