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:
|
2023-07-19 23:56:50 +00:00
|
|
|
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
2023-03-10 20:13:14 +00:00
|
|
|
|
|
|
|
- name: Run lychee link checker
|
|
|
|
id: lychee
|
2023-07-19 23:56:50 +00:00
|
|
|
uses: lycheeverse/lychee-action@ec3ed119d4f44ad2673a7232460dc7dff59d2421 # v1.8.0
|
2023-03-10 20:13:14 +00:00
|
|
|
with:
|
2023-04-05 17:58:29 +00:00
|
|
|
args: ./website/content/docs/ --base https://developer.hashicorp.com/ --exclude-all-private --exclude '\.(svg|gif|jpg|png)' --exclude 'manage\.auth0\.com' --accept 403 --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
|
2023-07-19 23:56:50 +00:00
|
|
|
uses: peter-evans/create-issue-from-file@433e51abf769039ee20ba1293a088ca19d573b7f # v4.0.1
|
2023-03-10 20:13:14 +00:00
|
|
|
with:
|
|
|
|
title: Link Checker Report
|
|
|
|
content-filepath: ./lychee/out.md
|
|
|
|
labels: report, automated issue
|