Link Checker: Daily #802
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Link Checker: Daily' | |
# **What it does**: This script once a day checks all English links and reports in issue if any are broken. | |
# **Why we have it**: We want to know if any links break internally or externally. | |
# **Who does it impact**: Docs content. | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '40 19 * * *' # once a day at 19:40 UTC / 11:40 PST | |
permissions: | |
contents: read | |
issues: write | |
jobs: | |
check_all_english_links: | |
name: Check all links | |
if: github.repository == 'github/docs-internal' | |
runs-on: ubuntu-20.04-xl | |
steps: | |
- name: Check that gh CLI is installed | |
run: gh --version | |
- name: Check out repo's default branch | |
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748 | |
- name: Setup Node | |
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 | |
with: | |
node-version: '16.15.0' | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Figure out which docs-early-access branch to checkout, if internal repo | |
if: ${{ github.repository == 'github/docs-internal' }} | |
id: check-early-access | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
GITHUB_TOKEN: ${{ secrets.DOCUBOT_REPO_PAT }} | |
run: node .github/actions-scripts/what-docs-early-access-branch.js | |
- name: Check out docs-early-access too, if internal repo | |
if: ${{ github.repository == 'github/docs-internal' }} | |
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748 | |
with: | |
repository: github/docs-early-access | |
token: ${{ secrets.DOCUBOT_REPO_PAT }} | |
path: docs-early-access | |
ref: ${{ steps.check-early-access.outputs.branch }} | |
- name: Merge docs-early-access repo's folders | |
if: ${{ github.repository == 'github/docs-internal' }} | |
run: .github/actions-scripts/merge-early-access.sh | |
- name: Run link checker | |
env: | |
LEVEL: 'critical' | |
# Set this to true in repo scope to enable debug logs | |
# ACTIONS_RUNNER_DEBUG = true | |
ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_FR }} | |
REPORT_AUTHOR: docubot | |
REPORT_LABEL: broken link report | |
REPORT_REPOSITORY: github/docs-content | |
CREATE_REPORT: true | |
CHECK_EXTERNAL_LINKS: true | |
PATIENT: true | |
timeout-minutes: 30 | |
run: node .github/actions/rendered-content-link-checker.js | |
- name: Upload artifact(s) | |
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 | |
with: | |
name: artifacts | |
path: ./artifacts |