-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add markdown link verification for PRs #26219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Implement Parse-ChangelogLinks.ps1 to parse markdown files and extract links. - Create Verify-MarkdownLinks.ps1 to verify the accessibility of extracted links. - Define action.yml for the markdown link verification action with necessary inputs and outputs. - Add README.md to document usage and features of the markdown link verification action. - Set up verify-markdown-links.yml workflow to automate link verification on push and pull request events.
… error handling and retry logic
… in pull requests and pushes
…403, 429) and improve error reporting for failed links
…trying with GET for specific status codes (404, 405)
This reverts commit 60ec84e.
|
I'm not sure |
|
|
/azp run PowerShell-CI-linux-packaging, PowerShell-Windows-Packaging-CI |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a comprehensive GitHub Actions workflow and composite action for verifying markdown links. The solution provides automated link validation for pull requests and scheduled runs, using PowerShell and the Markdig library to parse markdown files and verify both HTTP/HTTPS and local file links.
- New GitHub Action Implementation: Creates a composite action that detects changed markdown files and runs link verification with configurable timeouts, retries, and exclusion patterns
- PowerShell Scripts for Link Processing: Implements robust markdown parsing and link verification with detailed error reporting and metrics output
- Documentation and Workflow Configuration: Adds comprehensive documentation and example workflow configurations for CI/CD integration
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/verify-markdown-links.yml |
Workflow configuration that triggers link verification on markdown file changes and scheduled runs |
.github/instructions/powershell-parameter-naming.instructions.md |
Documentation defining PowerShell parameter naming conventions for consistency |
.github/actions/infrastructure/markdownlinks/action.yml |
Composite action definition with input/output specifications and step implementations |
.github/actions/infrastructure/markdownlinks/Verify-MarkdownLinks.ps1 |
Main verification script that processes links, handles retries, and generates detailed reports |
.github/actions/infrastructure/markdownlinks/README.md |
Comprehensive documentation with usage examples, configuration options, and testing instructions |
.github/actions/infrastructure/markdownlinks/Parse-MarkdownLink.ps1 |
Markdown parsing script using Markdig to extract various link types from markdown files |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
.github/actions/infrastructure/markdownlinks/Verify-MarkdownLinks.ps1
Outdated
Show resolved
Hide resolved
.github/actions/infrastructure/markdownlinks/Parse-MarkdownLink.ps1
Outdated
Show resolved
Hide resolved
…nks.ps1 Co-authored-by: Copilot <[email protected]>
…nks.ps1 Co-authored-by: xtqqczze <[email protected]>
|
📣 Hey @@TravisEz13, how did we do? We would love to hear your feedback with the link below! 🗣️ 🔗 https://aka.ms/PSRepoFeedback |
Co-authored-by: Copilot <[email protected]> Co-authored-by: xtqqczze <[email protected]>
Co-authored-by: Copilot <[email protected]> Co-authored-by: xtqqczze <[email protected]>
Co-authored-by: Copilot <[email protected]> Co-authored-by: xtqqczze <[email protected]>
Co-authored-by: Copilot <[email protected]> Co-authored-by: xtqqczze <[email protected]>
Co-authored-by: Copilot <[email protected]> Co-authored-by: xtqqczze <[email protected]>
Co-authored-by: Copilot <[email protected]> Co-authored-by: xtqqczze <[email protected]>
Co-authored-by: Copilot <[email protected]> Co-authored-by: xtqqczze <[email protected]>
Co-authored-by: Copilot <[email protected]> Co-authored-by: xtqqczze <[email protected]>
PR Summary
This pull request introduces a new GitHub composite action for verifying all links in markdown files using PowerShell and the Markdig library. The action is designed for CI/CD workflows and provides robust link extraction, verification, exclusion patterns, and detailed reporting. The main components added include the action definition, supporting PowerShell scripts for parsing and verifying links, and comprehensive documentation.
The most important changes are:
New GitHub Action Implementation
action.yml) that detects changed markdown files in pull requests or pushes, runs link verification only on those files, and outputs verification metrics for use in downstream steps. The action supports parameters for file paths, exclusion patterns, timeouts, and error handling.PowerShell Link Verification Scripts
Verify-MarkdownLinks.ps1, a script that extracts links from markdown files, deduplicates them, verifies each (supporting HTTP/HTTPS and local files), applies exclusion patterns, and prints a summary with error details. Exits with a nonzero code if failures are found and requested.Parse-MarkdownLink.ps1, a script that uses Markdig to parse markdown files and extract all types of links (inline, reference, autolink), returning structured information including file, line, and column.Documentation
README.mddocumenting the action's features, usage, configuration options, outputs, requirements, and example workflows.PR Context
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header