Skip to content

Create dead link checker workflow #3

Create dead link checker workflow

Create dead link checker workflow #3

Workflow file for this run

name: Link Check
on:
repository_dispatch:
pull_request:
schedule:
- cron: "0 0 * * *"
jobs:
linkCheck:
runs-on: ubuntu-latest
steps:
- name: Checkout Actions
uses: actions/checkout@v4
- name: Link Check
id: lychee
uses: lycheeverse/lychee-action@v1
with:
args: --base <https://vald.vdaas/org/docs>
output: ./check.md
fail: false
- name: Create Issue From File
if: env.lychee_exit_code != 0 && github.event_name != 'pull_request'
run: |
ISSUE_TITLE="Dead Links were detected"
gh issue create --title ISSUE_TITLE \
--body-file ./check.md
env:
GITHUB_USER: ${{ secrets.DISPATCH_USER }}
GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }}
- name: Add Comment On Pull Request From File
if: env.lychee_exit_code != 0 && github.event_name == 'pull_request'
run: |
gh pr comment ${{ github.event.number }} --body-file ./check.md
env:
GITHUB_USER: ${{ secrets.DISPATCH_USER }}
GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }}