This new gem ships with a ton of features, far too much for one post.
So this will be a series.
Open Collective README updater
- Script:
exe/kettle-readme-backers - Purpose: Updates README sections for Open Collective backers (individuals) and sponsors (organizations) by fetching live data from your collective.
- Tags updated in README.md (first match wins for backers):
- The default tag prefix is
OPENCOLLECTIVE, and it is configurable: - ENV:
KETTLE_DEV_BACKER_README_OSC_TAG="OPENCOLLECTIVE" - YAML (.opencollective.yml):
readme-osc-tag: "OPENCOLLECTIVE" - The resulting markers become:
<!-- <TAG>:START --> β¦ <!-- <TAG>:END -->,<!-- <TAG>-INDIVIDUALS:START --> β¦ <!-- <TAG>-INDIVIDUALS:END -->, and<!-- <TAG>-ORGANIZATIONS:START --> β¦ <!-- <TAG>-ORGANIZATIONS:END -->. - ENV overrides YAML.
- Backers (Individuals):
<!-- <TAG>:START --> β¦ <!-- <TAG>:END -->or<!-- <TAG>-INDIVIDUALS:START --> β¦ <!-- <TAG>-INDIVIDUALS:END --> - Sponsors (Organizations):
<!-- <TAG>-ORGANIZATIONS:START --> β¦ <!-- <TAG>-ORGANIZATIONS:END -->
- The default tag prefix is
- Handle resolution:
-
OPENCOLLECTIVE_HANDLEenvironment variable, if set -
opencollective.ymlin the project root (collective: "kettle-rb"by default in this repo)
-
- Usage:
exe/kettle-readme-backersOPENCOLLECTIVE_HANDLE=my-collective exe/kettle-readme-backers
- Behavior:
- Writes to README.md only if content between the tags would change.
- If neither the backers nor sponsors tags are present, prints a helpful warning and exits with status 2.
- When there are no entries, inserts a friendly placeholder: "No backers yet. Be the first!" or "No sponsors yet. Be the first!".
- When updates are written and the repository is a git work tree, the script stages README.md and commits with a message thanking new backers and subscribers, including mentions for any newly added backers and subscribers (GitHub @handles when their website/profile is a github.com URL; otherwise their name).
- Customize the commit subject via env var:
KETTLE_README_BACKERS_COMMIT_SUBJECT="πΈ Thanks π to our new backers π and subscribers π". - Or via .opencollective.yml: set
readme-backers-commit-subject: "πΈ Thanks π to our new backers π and subscribers π". - Precedence: ENV overrides .opencollective.yml; if neither is set, a sensible default is used.
- Note: When used with the provided
.git-hooks, the subject should start with a gitmoji character (see gitmoji).
- Tip: Run this locally before committing to keep your README current, or schedule it in CI to refresh periodically.
Support & Funding Info
I am a full-time FLOSS maintainer. If you find my work valuable I ask that you become a sponsor. Every dollar helps!
Photo (cropped) by Stavan Macwan on Unsplash
Top comments (0)