⚙️ [Maintenance]: Fix Update-FontsData script: gh CLI json args and hardcoded repo name#152
Merged
MariusStorhaug merged 1 commit intomainfrom Feb 10, 2026
Merged
Conversation
Contributor
No Significant Changes DetectedThis PR does not contain changes to files that would trigger a new release:
Build, test, and publish stages will be skipped for this PR. If you believe this is incorrect, please verify that your changes are in the correct locations. |
There was a problem hiding this comment.
Pull request overview
Fixes failures in the Update-FontsData automation by correcting how gh CLI arguments are passed and removing a hardcoded repo reference to improve portability.
Changes:
- Quote
gh --jsonfields as'number,title'to avoid PowerShell argument-splitting. - Replace hardcoded
PSModule/GoogleFontsinghcommands with$env:GITHUB_REPOSITORY. - Fix
Run h pr closetypo toRun gh pr close.
Comments suppressed due to low confidence (1)
scripts/Update-FontsData.ps1:41
- PR description states the script is now portable for forks/renames via $env:GITHUB_REPOSITORY, but the GitHub App connection and repository lookup are still hardcoded to organization/repo (
Connect-GitHubApp -Organization 'PSModule'andGet-GitHubRepository -Owner 'PSModule' -Name 'GoogleFonts'). Either derive owner/name from $repoName here as well (to truly support forks) or adjust the PR description to scope the portability claim to theghCLI calls only.
Install-PSResource -Repository PSGallery -TrustRepository -Name 'Json'
Connect-GitHubApp -Organization 'PSModule' -Default
$repo = Get-GitHubRepository -Owner 'PSModule' -Name 'GoogleFonts'
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
The Update-FontsData workflow script now correctly passes arguments to the
ghCLI and uses theGITHUB_REPOSITORYenvironment variable instead of a hardcoded repository name, making the script portable and fixing the workflow failure.Fix
--jsonargument parsingThe
--json number, titleargument was split by PowerShell into two separate arguments (number,andtitle), causingghCLI to reportUnknown JSON field: "number title". The argument is now quoted as'number,title'to ensure it is passed as a single value.Replace hardcoded repository name with variable
All four occurrences of the hardcoded
'PSModule/GoogleFonts'repo name inghCLI calls have been replaced with a$repoNamevariable, set from$env:GITHUB_REPOSITORY. This makes the script work correctly in any fork or renamed repository without code changes.Fix
ghCLI typoA typo in the PR close command (
Run h pr closeinstead ofRun gh pr close) has been corrected.