-
Notifications
You must be signed in to change notification settings - Fork 0
🩹 [Patch]: Switch to use GITHUB_TOKEN for updates
#68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… improved command execution and error handling
…t process with detailed output
There was a problem hiding this 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-NativeCommandhelper 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 |
… and error handling
… Run for improved command execution consistency
… enhance command execution clarity
…e change detection logic
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 includecontents: writeandpull-requests: write, enabling the workflow to create pull requests and write changes to the repository..github/workflows/Update-FontsData.yml: Addedfetch-depth: 0to the checkout step to ensure complete history is fetched, supporting branch operations. Removed unusedClientIDandPrivateKeyinputs from theUpdate-FontsDatajob.Script Enhancements:
scripts/Update-FontsData.ps1: Introduced theInvoke-NativeCommandfunction 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
Checklist