Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nightly link checker. #693

Merged
merged 3 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: Web3Signer docs nightly build - Failure
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MSG_MINIMAL: true