thoughtbot / factory_bot

A library for setting up Ruby objects as test data.
https://thoughtbot.com
MIT License
7.89k stars 2.6k forks source link

Only run this workflow if the README has been updated #1635

Closed stefannibrasil closed 2 months ago

stefannibrasil commented 2 months ago

In the templates repo, the update-templates workflow has been updated to accommodate repositories that have main branch rules (like factory_bot). To generate the README dynamically, you’ll need to merge a PR with the README changes. That will trigger the GitHub workflow

The PR won’t be generated if the footer content does not have any differences from the template. The PR will only be opened if there’s an update to the footer snippet.

In this PR, we are limiting this workflow to be triggered only when README changes have been merged to main (where the snippet lives).

stefannibrasil commented 2 months ago

Thanks for your patience, @mike-burns this is the follow up of https://github.com/thoughtbot/factory_bot/pull/1630

In summary, some repos have branch protection rules that conflicted with the workflow pushing changes directly to the main branch. In the templates repo, the workflow has been updated to open a PR with the README updates. So it will follow the regular flow of PR -> merge. Thank you!