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:
|
2024-01-27 00:11:27 +00:00
|
|
|
- cron: "0 0 1 * *"
|
2023-03-10 20:13:14 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
linkChecker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-05-14 19:49:03 +00:00
|
|
|
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
2023-03-10 20:13:14 +00:00
|
|
|
|
|
|
|
- name: Run lychee link checker
|
|
|
|
id: lychee
|
2024-05-14 19:49:03 +00:00
|
|
|
uses: lycheeverse/lychee-action@2b973e86fc7b1f6b36a93795fe2c9c6ae1118621 # v1.10.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
|
2024-05-14 19:49:03 +00:00
|
|
|
uses: peter-evans/create-issue-from-file@24452a72d85239eacf1468b0f1982a9f3fec4c94 # v5.0.0
|
2023-03-10 20:13:14 +00:00
|
|
|
with:
|
|
|
|
title: Link Checker Report
|
|
|
|
content-filepath: ./lychee/out.md
|
2024-01-27 00:11:27 +00:00
|
|
|
labels: report, automated issue
|