Skip to content

Commit

Permalink
Add nightly link checker. (#1676)
Browse files Browse the repository at this point in the history
* Add nightly link checker.

Signed-off-by: bgravenorst <[email protected]>

* Apply suggestions from code review

Co-authored-by: Joan E <[email protected]>
Signed-off-by: Byron Gravenorst <[email protected]>

---------

Signed-off-by: bgravenorst <[email protected]>
Signed-off-by: Byron Gravenorst <[email protected]>
Co-authored-by: Joan E <[email protected]>
  • Loading branch information
bgravenorst and joaniefromtheblock authored Aug 22, 2024
1 parent 1015044 commit aef892e
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/link-check.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"ignorePatterns": [
{
"pattern": "^http(s)?://localhost"
},
{
"pattern": "^http(s)?://127.0.0.1"
},
{
"comment": "This is a private repos",
"pattern": "^http(s)?://gitlab.com/ConsenSys/"
},
{
"comment": "This is a private repos",
"pattern": "^http(s)?://github.com/ConsenSys/orchestrate"
},
{
"comment": "This is a private repo",
"pattern": "^http(s)?://github.com/INFURA/docs(?:/(issues|pulls))?"
},
{
"comment": "Consensys.net now has DDoS attack protection",
"pattern": "^http(s)?://consensys.net"
},
{
"comment": "Exclude addresses with extra data variable placeholders (not yet replaced when checking for links)",
"pattern": "{{[a-zA-Z_\\-\\.\\[\\]\\']+}}"
},
{
"comment": "Exclude Infura endpoints that require an API key",
"pattern": "^https?:\\/\\/[a-zA-Z0-9.-]*\\.infura\\.io\\/v3\\/.*$"
},
{
"pattern": "^http(s)?://.+.zendesk.com"
},
{
"pattern": "^http(s)?://.+.etherscan.io"
},
{
"pattern": "^http(s)?://help.figma.com"
},
{
"pattern": "^http(s)?://(docs\\.)?metamask\\.io"
},
{
"comment": "Skip URLs in the redoc macro with entity",
"pattern": "http(s)?://.+\\&\\#39\\;"
},
{
"comment": "Skip URLs in the redoc macro with char",
"pattern": "http(s)?://.+'"
}
],
"httpHeaders": [
{
"urls": [
"https://github.com/",
"https://guides.github.com/",
"https://help.github.com/",
"https://docs.github.com/"
],
"headers": {
"Accept-Encoding": "zstd, br, gzip, deflate"
}
}
],
"timeout": "30s",
"aliveStatusCodes": [200, 206, 403],
"retryOn429": true
}
45 changes: 45 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Nightly check

on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch: {}

concurrency:
group: nightly-${{ github.ref }}
cancel-in-progress: true

jobs:
linkCheck:
name: Run link check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: LinkCheck
id: linkcheck
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
folder-path: './docs'
check-modified-files-only: 'no'
base-branch: main
config-file: './.github/workflows/link-check.json'

slackNotification:
needs: linkCheck
if: ${{ failure() }}
runs-on: ubuntu-latest
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: doc-ci-alerts
SLACK_COLOR: danger
SLACK_USERNAME: ci
SLACK_TITLE: Hyperledger Besu docs nightly build - Failure
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MSG_MINIMAL: true

0 comments on commit aef892e

Please sign in to comment.