-
Notifications
You must be signed in to change notification settings - Fork 54
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
Update google fonts on release instead of on a schedule #461
Conversation
It was commented out for testing on a fork.
bd7d8b5
to
32643de
Compare
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.
Thanks for working on this! Tested in a fork and the "Update Google Fonts JSON file" and "Commit Changes" steps passed without errors. Code looks good to me!
I think this is ready to bring in - I have one question but it's not a blocker.
I reviewed this post-merge, mostly to learn more about how create-block-theme releases work. Thanks for the specific testing instructions, everything worked as expected on my fork (I did need to add a GOOGLE_FONTS_API_KEY env secret first, since I didn't have that). One risk this approach seems to create is that it removes a manual review before committing the Google fonts configuration, since that's now tied to an automated release process. For example, if the fonts API request returned successfully, but had erroneous data, like an empty array of fonts, I think that would be committed automatically to the plugin as is was released. Is that right? It's an unlikely scenario, so not a huge risk. But a nice improvement might be some basic checking of the fonts API response in the update script to make sure it looks to as expected, and throwing an error if any problems are detected. |
Currently, the data from the Google Fonts API is being updated every Tuesday, but pulling the new data makes sense closer to a release since, before that, current plugin installations won't consume it.
Here, I propose moving the automated workflow of the update to the Release Workflow so that this may be done when needed.
Testing:
trunk
assets/google-fonts/fallback-fonts-list.json
.The "Update Google Fonts JSON file" and "Commit Changes" steps should pass without errors.
Note that in your fork, the full workflow will report a failure, since you'll be missing the secrets necessary to actually deploy the plugin; this is expected.