Skip to content
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

Call dynamic-readme reusable workflow #57

Merged
merged 3 commits into from
May 3, 2024

Conversation

stefannibrasil
Copy link

@stefannibrasil stefannibrasil commented Mar 14, 2024

We want to have a way to edit our README footer at one place and have the changes from there be propagated to our repos.

By adding this snippet in the README, we call this reusable workflow: https://github.com/thoughtbot/templates/blob/main/.github/workflows/dynamic-readme.yaml that renders the README footer dynamically.

This workflow has been updated to accommodate repositories that have main branch rules. 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 does not have any differences. It will only be open if there’s an update to the footer snippet.

We want to have a way to edit our README footer at one place and have the changes from there be propagated to our repos.

By adding this snippet in the README, we call this reusable workflow: https://github.com/thoughtbot/templates/blob/main/.github/workflows/dynamic-readme.yaml that renders and updates the README footer dynamically.
[thoughtbot]: https://thoughtbot.com/?utm_source=github
[community]: https://thoughtbot.com/community?utm_source=github
[hire]: https://thoughtbot.com/hire-us?utm_source=github
<!-- START /templates/footer.md -->
Copy link
Member

Choose a reason for hiding this comment

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

I appreciate you've probably done this elsewhere by now, but the leading / implies to me the start of a filesystem, which it presumably isn't. Can that go?

Copy link
Author

Choose a reason for hiding this comment

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

Hi Nick. If I remove that, the workflow can't find the file in the templates repo. I tried that before and it only worked like this. I was trying a bunch of things at the time, though. Maybe it's not needed anymore? I can try removing it and see if it works later this week.

Copy link
Member

Choose a reason for hiding this comment

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

Oh interesting, that's weird! Let me know how you get on, I'm curious!

Copy link
Author

Choose a reason for hiding this comment

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

Okay, thanks for your patience, Nick! I tested without the leading / on this test repo and it worked:

https://github.com/thoughtbot/testing-reusable-workflow

so we're good to go without it. Thanks for bringing that up. I also updated the original workflow to open a PR with the README changes because some repos have a protected branch rule.

Copy link
Author

Choose a reason for hiding this comment

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

Removing it in thoughtbot/templates#31

Copy link
Author

Choose a reason for hiding this comment

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

So after merging that, the dynamic readme doesn't work. I don't really know why but removing the "/" doesn't work, so we need it.

@nickcharlton nickcharlton merged commit 97dd0ca into main May 3, 2024
3 checks passed
@nickcharlton nickcharlton deleted the sb-dynamic-readme-workflow branch May 3, 2024 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants