Skip to content

Conversation

aidankmcalister
Copy link
Member

@aidankmcalister aidankmcalister commented Oct 15, 2025

Summary by CodeRabbit

  • Chores
    • Added automated link validation to the CI pipeline for pull requests to ensure external and internal links remain healthy.
    • When link checks fail, the pipeline will mark the run as failed and automatically open an issue with a detailed report to aid remediation.
    • Included a commented alternative link-checking option for potential future use.

Copy link
Contributor

Dangerous URL check

No absolute URLs to prisma.io/docs found.
No local URLs found.

Copy link
Contributor

coderabbitai bot commented Oct 15, 2025

Walkthrough

Adds a GitHub Actions workflow (.github/workflows/lychee.yml) that runs on pull_request to run lycheeverse/lychee-action@v2, fails on link errors, and on failure creates an issue from ./lychee/out.md using peter-evans/create-issue-from-file@v5. Includes a commented Linkspector alternative.

Changes

Cohort / File(s) Summary
CI workflow: link checking
.github/workflows/lychee.yml
Added PR-triggered workflow running lycheeverse/lychee-action@v2 with fail: true and workingDirectory; on non-zero exit invokes peter-evans/create-issue-from-file@v5 to create a "Lychee Report" issue labeled report, automated issue; includes a commented-out Linkspector alternative block.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title “DC-5259 Added Lychee Link Checker” succinctly captures the primary change by indicating the addition of a Lychee link checker and references the associated ticket for context. It directly relates to the content of the workflow addition in the changeset without including irrelevant details. The phrasing is clear and informative for teammates reviewing the PR history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b886e14 and d1c5be6.

📒 Files selected for processing (1)
  • .github/workflows/lychee.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/lychee.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: runner / linkspector

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Redirect check

This PR probably requires the following redirects to be added to static/_redirects:

  • This PR does not change any pages in a way that would require a redirect.

Copy link

cloudflare-workers-and-pages bot commented Oct 15, 2025

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: d1c5be6
Status: ✅  Deploy successful!
Preview URL: https://a9f72b1a.docs-51g.pages.dev
Branch Preview URL: https://dc-5259-lychee-link-checker.docs-51g.pages.dev

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/lychee.yml (1)

2-2: Consider adding manual and scheduled triggers.

Add workflow_dispatch and a weekly schedule to catch rot outside PRs.

-on: [pull_request]
+on:
+  pull_request:
+  workflow_dispatch:
+  schedule:
+    - cron: '0 6 * * 1' # Mondays 06:00 UTC
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b40389e and b886e14.

📒 Files selected for processing (1)
  • .github/workflows/lychee.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Check internal links
  • GitHub Check: runner / linkspector
  • GitHub Check: Cloudflare Pages

Comment on lines 12 to 24
- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v2
with:
fail: true

- name: Create Issue From File
if: steps.lychee.outputs.exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Create-issue step will never run; missing lychee output file. Fix failure flow and configure output.

  • fail: true causes the job to stop on Line 14; the “Create Issue From File” step won’t run.
  • ./lychee/out.md is never produced; no output/format configured for the action.
  • Step condition should use expression syntax; also guard for forked PRs to avoid permission failures.

Apply this diff to make the report creation reliable and still fail the job:

       - name: Link Checker
         id: lychee
         uses: lycheeverse/lychee-action@v2
+        continue-on-error: true
         with:
-          fail: true
+          # Let the workflow control failure after creating the issue
+          fail: false
+          # Use the token to improve rate limits (e.g. GitHub links)
+          token: ${{ secrets.GITHUB_TOKEN }}
+          # Produce a markdown report file for the next step
+          format: markdown
+          output: ./lychee/out.md
+
+      - name: Ensure report directory exists
+        run: mkdir -p lychee

       - name: Create Issue From File
-        if: steps.lychee.outputs.exit_code != 0
+        if: ${{ steps.lychee.outputs.exit_code != 0 && github.event.pull_request.head.repo.fork == false }}
         uses: peter-evans/create-issue-from-file@v5
         with:
           title: Link Checker Report
           content-filepath: ./lychee/out.md
           labels: report, automated issue
+
+      - name: Fail workflow if broken links found
+        if: ${{ steps.lychee.outputs.exit_code != 0 }}
+        run: exit 1

This preserves PR failure on bad links, creates the issue when possible, and avoids write attempts from forked PRs.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v2
with:
fail: true
- name: Create Issue From File
if: steps.lychee.outputs.exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue
- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v2
continue-on-error: true
with:
# Let the workflow control failure after creating the issue
fail: false
# Use the token to improve rate limits (e.g. GitHub links)
token: ${{ secrets.GITHUB_TOKEN }}
# Produce a markdown report file for the next step
format: markdown
output: ./lychee/out.md
- name: Ensure report directory exists
run: mkdir -p lychee
- name: Create Issue From File
if: ${{ steps.lychee.outputs.exit_code != 0 && github.event.pull_request.head.repo.fork == false }}
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue
- name: Fail workflow if broken links found
if: ${{ steps.lychee.outputs.exit_code != 0 }}
run: exit 1
🤖 Prompt for AI Agents
.github/workflows/lychee.yml lines 12-24: the lychee action is currently
configured with fail: true so the job stops and the "Create Issue From File"
step never runs, and no output file is configured; change lychee to run
non-fatal (set fail: false) and configure its output format/file (e.g., format:
md and output: ./lychee/out.md) so the action produces ./lychee/out.md and
exposes an exit_code output, update the Create Issue step to use the expression
syntax for the condition (if: steps.lychee.outputs.exit_code != '0') and
additionally guard against runs from forked PRs by checking the repo identity
(e.g., if: steps.lychee.outputs.exit_code != '0' &&
github.event.pull_request.head.repo.full_name == github.repository) so it won't
attempt to write from forks, and finally add a short step after to fail the job
when exit_code != '0' (run: exit 1 with the same guarded if) so the workflow
still fails on bad links while allowing report creation when permitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant