Skip to content

Commit

Permalink
Add remaining repos to be updated when this workflow is triggered (#30)
Browse files Browse the repository at this point in the history
* Add remaining repos to be updated when this workflow is triggered

All of these repos have had the workflow and snippet added to them.

Unfortunately, for this workflow to work, GitHub seems to need the repo list to be defined explicitly, instead of using `github.repository` or something else more generic.

Using a matrix, we can iterate over the repo list in the steps section. Not sure if there is a better way to do this, though.

* Update README and footer sections with template

Also, add instructions on how to use the template
when creating a new repo.

* Document additional step for dynamic README

Besides adding the workflow to the new repo being created,
the new repo path needs to be added to the repo list matrix in the
dispatch workflow. This way, GitHub will propagate the footer
updates to all repos in the list.
  • Loading branch information
Stefanni Brasil authored Mar 15, 2024
1 parent 738afc4 commit b895b4c
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 31 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/dynamic-readme-example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: update-templates

on:
push:
branches:
- main
workflow_dispatch:

jobs:
update-templates:
permissions:
contents: write
pull-requests: write
pages: write
uses: thoughtbot/templates/.github/workflows/dynamic-readme.yaml@main
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
46 changes: 45 additions & 1 deletion .github/workflows/trigger-dynamic-readme-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,51 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
repository: [thoughtbot/high_voltage]
repository:
- thoughtbot/high_voltage
- thoughtbot/guides
- thoughtbot/administrate
- thoughtbot/shoulda-matchers
- thoughtbot/flightdeck
- thoughtbot/suspenders
- thoughtbot/shoulda-context
- thoughtbot/appraisal
- thoughtbot/clearance-i18n
- thoughtbot/gold_miner
- thoughtbot/capybara_accessibility_audit
- thoughtbot/upcase
- thoughtbot/ruby-science
- thoughtbot/terraform-flightdeck-aws-application
- thoughtbot/design-system
- thoughtbot/factory_bot_rails
- thoughtbot/bourbon
- thoughtbot/factory_bot
- thoughtbot/ember-cli-rails
- thoughtbot/dotfiles
- thoughtbot/terraform-ses-domain-identity
- thoughtbot/stylelint-config
- thoughtbot/cloudformation-terraform-state-backend
- thoughtbot/humid
- thoughtbot/clearance
- thoughtbot/griddler-sendgrid
- thoughtbot/terraform-aws-secrets
- thoughtbot/yuri-ita
- thoughtbot/paul_revere
- thoughtbot/terraform-eks-cicd
- thoughtbot/terraform-s3-bucket
- thoughtbot/terraform-route-53-delegated-subdomain
- thoughtbot/eslint-config
- thoughtbot/rcm
- thoughtbot/fishery
- thoughtbot/terrapin
- thoughtbot/shoulda
- thoughtbot/laptop
- thoughtbot/resolved
- thoughtbot/griddler
- thoughtbot/climate_control
- thoughtbot/Curry
- thoughtbot/croutons
- thoughtbot/parity
steps:
- name: Trigger Dynamic READMEs to be updated with templates
uses: benc-uk/workflow-dispatch@v1
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,24 @@ cp templates/README.md.template my-awesome-project/README.md
$VISUAL my-awesome-project/README.md
```

### Dynamic content rendering for the footer

The [README.md.template](/README.md.template) includes a dynamic README
content snippet. That means the footer will be rendered and updated automatically
for you with the contents from the [footer](/templates/footer.md) template.

To make it work when using the [README.md.template](/README.md.template):
- copy the [github workflow example](/.github/workflows/dynamic-readme-example.yaml)
and rename it to `dynamic-readme`.
- add the repo path to the repository matrix in the [workflow dispatch](/.github/workflows/trigger-dynamic-readme-update.yaml).

## Contributing

See the [CONTRIBUTING] document.
Thank you, [contributors]!

[CONTRIBUTING]: CONTRIBUTING.md
[contributors]: https://github.com/thoughtbot/templates/graphs/contributors
[CONTRIBUTING]: CONTRIBUTING.md
[contributors]: https://github.com/thoughtbot/templates/graphs/contributors

## License

Expand All @@ -26,16 +37,5 @@ under the terms specified in the [LICENSE] file.

[LICENSE]: /LICENSE

## About

![thoughtbot](https://thoughtbot.com/thoughtbot-logo-for-readmes.svg)

Templates are maintained and funded by thoughtbot, inc.
The names and logos for thoughtbot are trademarks of thoughtbot, inc.

We love open source software!
See [our other projects][community]
or [hire us][hire] to help build your product.

[community]: https://thoughtbot.com/community?utm_source=github
[hire]: https://thoughtbot.com/hire-us?utm_source=github
<!-- START /templates/footer.md -->
<!-- END /templates/footer.md -->
17 changes: 2 additions & 15 deletions README.md.template
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,5 @@ under the terms specified in the [LICENSE] file.

[LICENSE]: /LICENSE

## About

$(PROJECT_NAME) is maintained by $(MAINTAINERS).

![thoughtbot](https://thoughtbot.com/thoughtbot-logo-for-readmes.svg)

$(PROJECT_NAME) is maintained and funded by thoughtbot, inc.
The names and logos for thoughtbot are trademarks of thoughtbot, inc.

We love open source software!
See [our other projects][community]
or [hire us][hire] to help build your product.

[community]: https://thoughtbot.com/community?utm_source=github
[hire]: https://thoughtbot.com/hire-us?utm_source=github
<!-- START /templates/footer.md -->
<!-- END /templates/footer.md -->

0 comments on commit b895b4c

Please sign in to comment.