Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Apr 11, 2023
1 parent a621360 commit 5206166
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 23 deletions.
29 changes: 29 additions & 0 deletions .github/scripts/markdown-link-check-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"retryOn429" : true,
"aliveStatusCodes" : [
200
],
"ignorePatterns" : [
{
"pattern" : "https://github.com/username"
},
{
"pattern" : "https://github.com/zhyChesterCheung"
},
{
"pattern" : "https://twitter.com"
},
{
"pattern" : "https://www.zocdoc.com"
},
{
"pattern" : "https://www.youtube.com"
},
{
"pattern" : "https://www.linkedin.com"
},
{
"pattern" : "https://dev.azure.com"
}
]
}
17 changes: 17 additions & 0 deletions .github/scripts/markdown-link-check-with-retry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash -e

# this script helps to reduce sporadic link check failures by retrying at a file-by-file level

retry_count=3

for file in "$@"; do
for i in $(seq 1 $retry_count); do
if markdown-link-check --config "$(dirname "$0")/markdown-link-check-config.json" \
"$file"; then
break
elif [[ $i -eq $retry_count ]]; then
exit 1
fi
sleep 5
done
done
24 changes: 1 addition & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,4 @@ concurrency:

jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: lycheeverse/[email protected]
with:
# TODO address youtube exclusion after resolving
# https://github.com/open-telemetry/community/issues/1406
args: >
--verbose
--exclude-path elections/2019/governance-committee-election.md
--exclude-path elections/2020/governance-committee-election.md
--exclude https://github.com/username
--exclude https://github.com/zhyChesterCheung
--exclude https://twitter.com
--exclude https://www.zocdoc.com
--exclude https://www.youtube.com
'./**/*.md'
fail: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- run: cat lychee/out.md
uses: ./.github/workflows/reusable-markdown-link-check.yml
24 changes: 24 additions & 0 deletions .github/workflows/reusable-markdown-link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Reusable - Markdown link check

on:
workflow_call:

jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install markdown-link-check
# fix version to 3.10.3 as 3.11.0 appears to ignore --config, so we can't specify our own
# configuration file
run: npm install -g [email protected]

- name: Run markdown-link-check
run: |
find . -type f \
-name '*.md' \
-not -path './elections/2019/governance-committee-election.md' \
-not -path './elections/2020/governance-committee-election.md' \
-not -path './elections/*/governance-committee-candidates.md' \
| xargs .github/scripts/markdown-link-check-with-retry.sh

0 comments on commit 5206166

Please sign in to comment.