Skip to content

ci: make removed URL check aware of docs/redirects.txt#6

Merged
danieltoader-canonical merged 1 commit into
canonical:mainfrom
rajannpatel:main
Jun 18, 2026
Merged

ci: make removed URL check aware of docs/redirects.txt#6
danieltoader-canonical merged 1 commit into
canonical:mainfrom
rajannpatel:main

Conversation

@rajannpatel

Copy link
Copy Markdown
Collaborator

Description

This PR updates the check-removed-urls.yml GitHub workflow to prevent false positives when a documentation page is intentionally removed or renamed, but a proper redirect has already been configured in docs/redirects.txt.

Previously, the workflow performed a strict text diff on the built HTML output. If a URL disappeared, the check failed immediately—completely unaware that a redirect existed.

Key Changes

  • Added workflow_call Inputs: Properly decoupled the base reference variables so this workflow can be cleanly reused by other pipelines.
  • Robust Path Normalization: Streamlined the find and sed pipeline to parse built HTML structures safely and output clean, predictable path formats.
  • Redirect-Aware Validation: Replaced the brittle Bash loop with an inline Python verification script. It parses docs/redirects.txt using the native csv module and checks all structural markdown possibilities (page.md, page/index.md, or directory-level paths) before flagging a URL as missing.

Testing Instructions

  1. If a PR removes a page without adding it to docs/redirects.txt, the workflow should fail and list the unhandled URL.
  2. If a PR removes a page and correctly logs the source path in docs/redirects.txt, the workflow should print a green checkmark (✅ Ignored) and pass successfully.

Checklist

  • Tested changes against private/public fork contexts
  • Handled empty lines and comment blocks inside redirects.txt
  • Validated fallback behavior for reusable workflow triggers

@danieltoader-canonical danieltoader-canonical merged commit 77c1e7d into canonical:main Jun 18, 2026
4 of 5 checks passed
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.

2 participants