Skip to content

Commit

Permalink
Add lychee link checker GitHub Action (#237)
Browse files Browse the repository at this point in the history
Inspired by kubecost/docs#704
Fixes #134

Signed-off-by: Matt Ray <[email protected]>
  • Loading branch information
mattray authored Jun 14, 2024
1 parent 55fb11e commit 91344df
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/checks-links.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Check Links

on:
repository_dispatch:
workflow_dispatch:
pull_request:
branches:
- main
schedule:
- cron: "0 0 * * *"

jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
fail: true
debug: false
args: --verbose --no-progress --base . -E './**/*.md' './**/*.mdx'

- name: Create Issue From 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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Check Links](https://github.com/org/repo/actions/workflows/links.yml/badge.svg)](https://github.com/org/repo/actions/workflows/links.yml)

# OpenCost Website

This repository hosts the [OpenCost website](https://opencost.io), documentation, and blog.
Expand Down

0 comments on commit 91344df

Please sign in to comment.