diff --git a/.github/workflows/link-check.json b/.github/workflows/link-check.json new file mode 100644 index 00000000000..1cb62f59cea --- /dev/null +++ b/.github/workflows/link-check.json @@ -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 +} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 00000000000..0624d95255c --- /dev/null +++ b/.github/workflows/nightly.yml @@ -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 \ No newline at end of file