Skip to content

⚙️ [Maintenance]: Fix Update-FontsData script: gh CLI json args and hardcoded repo name#152

Merged
MariusStorhaug merged 1 commit intomainfrom
fix/update-fonts-data-script
Feb 10, 2026
Merged

⚙️ [Maintenance]: Fix Update-FontsData script: gh CLI json args and hardcoded repo name#152
MariusStorhaug merged 1 commit intomainfrom
fix/update-fonts-data-script

Conversation

@MariusStorhaug
Copy link
Member

The Update-FontsData workflow script now correctly passes arguments to the gh CLI and uses the GITHUB_REPOSITORY environment variable instead of a hardcoded repository name, making the script portable and fixing the workflow failure.

Fix --json argument parsing

The --json number, title argument was split by PowerShell into two separate arguments (number, and title), causing gh CLI to report Unknown 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 in gh CLI calls have been replaced with a $repoName variable, set from $env:GITHUB_REPOSITORY. This makes the script work correctly in any fork or renamed repository without code changes.

Fix gh CLI typo

A typo in the PR close command (Run h pr close instead of Run gh pr close) has been corrected.

@MariusStorhaug MariusStorhaug added the NoRelease Do not create a release label Feb 10, 2026
@github-actions
Copy link
Contributor

No Significant Changes Detected

This PR does not contain changes to files that would trigger a new release:

Path Description
src/** Module source code
README.md Documentation

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.

@MariusStorhaug MariusStorhaug marked this pull request as ready for review February 10, 2026 10:30
Copilot AI review requested due to automatic review settings February 10, 2026 10:30
@MariusStorhaug MariusStorhaug self-assigned this Feb 10, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --json fields as 'number,title' to avoid PowerShell argument-splitting.
  • Replace hardcoded PSModule/GoogleFonts in gh commands with $env:GITHUB_REPOSITORY.
  • Fix Run h pr close typo to Run 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' and Get-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 the gh CLI 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.

@MariusStorhaug MariusStorhaug merged commit e3de578 into main Feb 10, 2026
49 of 50 checks passed
@MariusStorhaug MariusStorhaug deleted the fix/update-fonts-data-script branch February 10, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NoRelease Do not create a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Update-FontsData script: gh CLI json args and hardcoded repo name

1 participant