forked from CannonLock/test_links
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
59 lines (52 loc) · 1.57 KB
/
action.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
name: Build Website and Check Links
description: Builds a Jekyll Website and verifies the links inside it
inputs:
input_file:
required: false
description: A yaml file with with the
url_ignore:
required: false
description: The list of regex urls to ignore
default: ""
file_ignore:
required: false
description: The list of files to ignore
default: ""
runs:
using: "composite"
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true
- name: Build Jekyll Site
shell: bash
run: |
bundle install
bundle exec jekyll build
- name: Ensure jq and curl are installed
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y jq curl
- name: Fetch and process URLs
id: set-urls
shell: bash
run: |
urls=$(curl -s https://raw.githubusercontent.com/CHTC/test_links/refs/heads/master/links-action/ignore_urls.json | jq -r 'map("/" + . + "/") | join(",")' | sed 's/ //g')
echo "URLS=$urls" >> $GITHUB_ENV
- name: Test links
uses: docker://hub.opensciencegrid.org/opensciencegrid/html-proofer:latest
with:
args: >-
--ignore-empty-alt
--ignore-missing-alt
--no-enforce-https
--no-check-external-hash
--ignore-status-codes 302,401
--ignore-files "${{ inputs.file_ignore }}"
--ignore-urls "${{ env.URLS }},${{ inputs.url_ignore }}"
./_site