-
Notifications
You must be signed in to change notification settings - Fork 324
31 lines (31 loc) · 908 Bytes
/
ci.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
name: Check Links
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
check-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Install awesome_bot
run: gem install awesome_bot
- name: Check non-Medium/arXiv URLs
run: |
awesome_bot README.md --allow-redirect \
--request-delay 1 \
--set-timeout 10 \
--white-list medium.com,arxiv.org
- name: Check Medium URLs
run: |
medium_urls=$(grep -Eo 'https?://[^[:space:]]+medium.com[^[:space:]]*' README.md)
if [ ! -z "$medium_urls" ]; then
awesome_bot $medium_urls --allow-redirect --request-delay 10 --set-timeout 15
else
echo "No Medium URLs found"
fi