Skip to content

try to add a comment if lychee exit code isnt 0 #9

try to add a comment if lychee exit code isnt 0

try to add a comment if lychee exit code isnt 0 #9

Workflow file for this run

name: Dead Links (Fail Fast)
on:
pull_request:
jobs:
check-links-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Link Checker
uses: lycheeverse/[email protected]
with:
fail: true
args: --base . --verbose --no-progress 'README.md'
- name: Broken Link Detected
if: env.lychee_exit_code != 0
uses: actions/github-script@v6
with:
script: |
let fs = require('fs');
let report = fs.readFileSync('./lychee/out.md');
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: String(report)
})