Skip to content

Conversation

@MariusStorhaug
Copy link
Member

Description

This pull request introduces significant updates to the workflow and script for automating Google Fonts data updates. Key changes include enhancements to permissions in the GitHub Actions workflow, improved repository management in the PowerShell script, and refactoring for better logging and error handling.

Workflow Updates:

  • .github/workflows/Update-FontsData.yml: Updated permissions to include contents: write and pull-requests: write, enabling the workflow to create pull requests and write changes to the repository.
  • .github/workflows/Update-FontsData.yml: Added fetch-depth: 0 to the checkout step to ensure complete history is fetched, supporting branch operations. Removed unused ClientID and PrivateKey inputs from the Update-FontsData job.

Script Enhancements:

  • scripts/Update-FontsData.ps1: Introduced the Invoke-NativeCommand function to standardize execution of native commands with improved error handling and logging.
  • scripts/Update-FontsData.ps1: Refactored branch management logic to dynamically determine whether to create a new branch or use the current branch, ensuring compatibility with different workflow triggers.
  • scripts/Update-FontsData.ps1: Improved logging for changes detection, commit creation, and push operations. Added detailed output for diffs and commit logs to enhance debugging and visibility.

Type of change

  • 📖 [Docs]
  • 🪲 [Fix]
  • 🩹 [Patch]
  • ⚠️ [Security fix]
  • 🚀 [Feature]
  • 🌟 [Breaking change]

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@MariusStorhaug MariusStorhaug self-assigned this Jul 22, 2025
Copilot AI review requested due to automatic review settings July 22, 2025 09:03
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

This PR switches from using custom GitHub App authentication to the built-in GITHUB_TOKEN for automated Google Fonts data updates. The changes modernize the CI/CD workflow by leveraging standard GitHub Actions permissions and improving the PowerShell script's reliability and logging capabilities.

  • Replaced GitHub App authentication with standard GitHub Actions permissions (contents: write, pull-requests: write)
  • Added comprehensive error handling and logging through a new Invoke-NativeCommand helper function
  • Enhanced branch management logic to handle both scheduled runs and manual workflow dispatches

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
.github/workflows/Update-FontsData.yml Updated permissions and removed custom authentication parameters
scripts/Update-FontsData.ps1 Complete refactor with improved error handling, logging, and dynamic branch management

@MariusStorhaug MariusStorhaug added the NoRelease Do not create a release label Jul 22, 2025
@MariusStorhaug MariusStorhaug merged commit 6ed199f into main Jul 22, 2025
2 checks passed
@MariusStorhaug MariusStorhaug deleted the ghtok branch July 22, 2025 18:32
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.

2 participants