Add PR analyzer#2376
Open
Su (sushmangupta) wants to merge 2 commits into
Open
Conversation
Developer Docs healthcheckStatus: Completed with |
Contributor
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 |
Comment on lines
+3
to
+12
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - synchronize | ||
| - reopened | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write |
Comment on lines
+1
to
+12
| 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; | ||
|
|
Comment on lines
+226
to
+231
| 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)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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