Add PR analyzer - #2376
Conversation
Developer Docs healthcheckStatus: Completed with |
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions workflow plus a Node-based script intended to analyze documentation-related PR impact and post an automated summary comment back to the pull request.
Changes:
- Introduces a new workflow (
Documentation Impact Analyzer) that runs on PR open/sync/reopen. - Adds a PR impact analyzer script that scores changes based on title keywords and file/patch heuristics.
- Posts a formatted “Documentation Impact Analyzer” comment to the PR with score, recommendation, categories, and reasons.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
.github/workflows/pr-impact.yml |
Adds the PR-triggered GitHub Actions workflow to run the analyzer and (attempt to) comment on the PR. |
.github/scripts/pr-impact.js |
Implements the scoring heuristics and PR-comment creation via Octokit. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| npm install @actions/core @actions/github |
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - synchronize | ||
| - reopened | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write |
| const github = require("@actions/github"); | ||
|
|
||
| const token = process.env.GITHUB_TOKEN; | ||
|
|
||
| const octokit = github.getOctokit(token); | ||
|
|
||
| const context = github.context; | ||
|
|
||
| const owner = context.repo.owner; | ||
| const repo = context.repo.repo; | ||
| const pull_number = context.payload.pull_request.number; | ||
|
|
| await octokit.rest.issues.createComment({ | ||
| owner, | ||
| repo, | ||
| issue_number: pull_number, | ||
| body: comment | ||
| }); |
|
|
||
| // ---------- DEPRECATION ---------- | ||
|
|
||
| if (/deprecated/i.test(patch)) { |
|
|
||
| // ---------- BREAKING ---------- | ||
|
|
||
| if (/breaking/i.test(patch)) { |
📊 Documentation Impact Analyzer
Reasons
|
1 similar comment
📊 Documentation Impact Analyzer
Reasons
|
📊 Documentation Impact Analyzer
Reasons
|
📊 Documentation Impact Analyzer
Reasons
|
📊 Documentation Impact Analyzer
Reasons
|
📊 Documentation Impact Analyzer
Reasons
|
Summary
Related links
Checklist
PageRefreferences where relevant..gitbook.yamlif pages were moved, renamed, or deleted..wordlist.txt(and sorted it) if spellcheck flags new legitimate terms.Notes