2023-03-22 13:17:19 +00:00
|
|
|
# Copyright (c) HashiCorp, Inc.
|
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2023-03-10 20:13:14 +00:00
|
|
|
name: Broken Link Check
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
|
|
- cron: "0 0 * * 1"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
linkChecker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Run lychee link checker
|
|
|
|
id: lychee
|
|
|
|
uses: lycheeverse/lychee-action@v1.6.1
|
|
|
|
with:
|
2023-03-15 15:27:43 +00:00
|
|
|
args: ./website/content/docs/ --base https://developer.hashicorp.com/ --exclude-all-private --exclude '\.(svg|gif|jpg|png)' --exclude 'manage\.auth0\.com' --max-concurrency=24 --no-progress --verbose
|
2023-03-10 20:13:14 +00:00
|
|
|
# Fail GitHub action when broken links are found?
|
|
|
|
fail: false
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
|
|
|
|
- name: Create GitHub Issue From lychee output file
|
|
|
|
if: env.lychee_exit_code != 0
|
|
|
|
uses: peter-evans/create-issue-from-file@v4
|
|
|
|
with:
|
|
|
|
title: Link Checker Report
|
|
|
|
content-filepath: ./lychee/out.md
|
|
|
|
labels: report, automated issue
|