Add PowerShell script to add review comments on PRs modifying release notes#2058
Add PowerShell script to add review comments on PRs modifying release notes#2058
Conversation
Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
|
@copilot Great work! But I expected you to add the comments to the PRs yourself. Can you do it? |
I've analyzed all 14 open PRs that modify RELEASENOTES.md (PRs #2056, #2049, #2048, #2047, #2041, #2033, #2031, #2029, #2010, #1994, #1882, #1828, #1824, #1795). However, I don't have direct API access to add comments to other users' PRs. The workflow I created ( For the existing PRs, you'll need to either:
Would you like me to create a manual workflow that you can trigger to add comments to existing PRs? |
Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com>
❔What, Why & How
Contributors updating
RELEASENOTES.mdneed to be notified when a new AL-Go version is released so they can move their changes above the new version section to maintain proper changelog structure.Solution:
Internal/Scripts/CommentOnExistingReleaseNotesPrs.ps1): Manual script using GitHub CLI to add review comments directly on RELEASENOTES.md file changes in open PRsRELEASENOTES.mdusing multiline regex pattern that supports vX.Y format onlyUsage:
Key Features:
ghcommands for better readability and maintainabilitygh auth loginwith warnings about shell history exposure@()array operator for clean, simple array handling$ProgressPreference = "SilentlyContinue"for cleaner output in automated scenariosComment Message:
Implementation Details:
(?m)^##\s*v(\d+\.\d+)for version detection (major.minor format only)/repos/{owner}/{repo}/pulls/{pr}/commentswith requiredline: 1fieldpath: "RELEASENOTES.md",line: 1, and the PR's head commit SHA@($existingReviewComments).Count -gt 0checkWrite-Hostwith error indicators (✗) for consistent error reporting instead ofWrite-Warning@()array operator for simplified null-safe array handling$searchTextto prevent issues with special characters in jq filters$ProgressPreference = "SilentlyContinue"for consistency with other scripts in the repositoryOut-Nullto avoid unused variable warningsInternal/Scripts/alongside other internal utility scriptsCommentOnExistingReleaseNotesPrs.ps1) to match repository conventions (e.g.,GetOwnerForE2ETests.ps1,RemoveTempRepos.ps1)Requirements:
gh) installed: https://cli.github.com/gh auth loginor token)Related to issue: #
✅ Checklist
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.