53 lines
2.0 KiB
YAML
53 lines
2.0 KiB
YAML
name: Check all English links
|
|
|
|
# **What it does**: This script once a day checks all English links and reports in issues.
|
|
# **Why we have it**: We want to know if any links break.
|
|
# **Who does it impact**: Docs content.
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: '40 19 * * *' # once a day at 19:40 UTC / 11:40 PST
|
|
|
|
jobs:
|
|
check_all_english_links:
|
|
name: Check all links
|
|
if: github.repository == 'github/docs-internal'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
|
- name: npm ci
|
|
run: npm ci
|
|
- name: npm run build
|
|
run: npm run build
|
|
- name: Run script
|
|
run: |
|
|
script/check-english-links.js > broken_links.md
|
|
- if: ${{ failure() }}
|
|
name: Get title for issue
|
|
id: check
|
|
run: echo "::set-output name=title::$(head -1 broken_links.md)"
|
|
- if: ${{ failure() }}
|
|
name: Close previous report
|
|
uses: lee-dohm/close-matching-issues@22002609b2555fe18f52b8e2e7c07cbf5529e8a8
|
|
with:
|
|
query: 'label:"broken link report"'
|
|
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|
|
- if: ${{ failure() }}
|
|
name: Create issue from file
|
|
id: broken-link-report
|
|
uses: peter-evans/create-issue-from-file@a04ce672e3acedb1f8e416b46716ddfd09905326
|
|
with:
|
|
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|
|
title: ${{ steps.check.outputs.title }}
|
|
content-filepath: ./broken_links.md
|
|
labels: broken link report
|
|
- if: ${{ failure() }}
|
|
name: Add comment to issue
|
|
uses: peter-evans/create-or-update-comment@5221bf4aa615e5c6e95bb142f9673a9c791be2cd
|
|
with:
|
|
body: |
|
|
cc @github/docs-content
|
|
issue-number: ${{ steps.broken-link-report.outputs.issue-number }}
|
|
token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
|