GitHub profile READMEs are a great way to showcase your work, share your interests, and keep your followers updated. But manually updating your README can be time-consuming. With tools like readme-scribe and TuneFeed, you can automate this process and keep your profile fresh with the latest updates.
In this guide, we'll walk through how to set up your GitHub profile README to automatically include your latest Spotify activity using TuneFeed and readme-scribe.
TuneFeed allows you to generate RSS feeds from your Spotify activity. Follow these steps to set up TuneFeed:
<your-username>/<your-username>
, create one. This repository will hold your profile README.To automate the updates to your README, we'll use the a GitHub Action. All those steps are done in your <your-username>/<your-username>
repository.
You will need to create a new workflow file in your repository. This is how your .github/workflows/readme.yaml
file should look like:
name: Update README
on:
push:
schedule:
- cron: '0 * * * *' # Runs every hour
jobs:
markscribe:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@master
- uses: muesli/readme-scribe@master
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
with:
template: 'templates/README.md.tpl'
writeTo: 'README.md'
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'docs: Update generated README'
branch: master
commit_user_name: readme-scribe 🤖
commit_user_email: [email protected]
commit_author: readme-scribe 🤖 <[email protected]>
And the templates/README.md.tpl
is your template file. This is where you can define the content of your README. We will use a small example template to show you how to display the RSS feed content in your README. But, here you can see a more complete example on how to use readme-scribe.
### Hi there 👋
🎧 This is what I have been listening to recently:
{{- range rss "<Your TuneFeed RSS Feed URL>" }}
- [{{ .Title }}]({{ .URL }})
{{- end }}
Replace <Your TuneFeed RSS Feed URL>
with the RSS feed URL you copied from TuneFeed.
Commit the changes to your repository and push them to GitHub.
To make the GitHub Action work, you need to create a secret for it. This secret will be used to authenticate the GitHub Action with your GitHub account.
Use this link to create a new secret: https://github.com/settings/tokens/new?scopes=public_repo,read:user,read:org,repo:status&description=readme-scribe
Copy the secret and add go to your repository's settings, then go to the "Secrets and variables" > "Actions" section. Add a new repository secret with the name PERSONAL_GITHUB_TOKEN
and paste the copied secret value.
To test if everything is set up correctly, you can manually trigger the workflow:
<your-username>/<your-username>
repository.If everything is set up correctly, your profile should look something like this:
That's it! Your GitHub profile README will now be automatically updated with your latest Spotify activity, thanks to TuneFeed and readme-scribe. This setup ensures that your followers always see your current music trends without any manual updates.
Happy coding and happy listening!
Image generated by DALL-E from OpenAI