If you didn't know before you will know by the end, GitHub lets you customise your. public profile page for other to see, this is done using Markdown and a special reserved repository username/username.git or in my case: atownsend247/atownsend247.git. The layout of this repository is rather simple, you just need to write out a README.md file, this is then displayed on your profile.
This is obviously very boring and static by default, but we can make some improvements so it generates dynamic content. For example as I write some blog posts I'd like it to update my profile with the most recent articles that I've written rather than me having to copy the links in and updating the repository myself... ideal right.
Well the good news is this is perfectly achievable and here is how you could approach it.
Before this I hadn't really played around with GitHub Workflows but this was a nice excuse to do so, GitHub allows you to run some automated actions either via repository triggers or at scheduled intervals. At the time of writing these Workflows have been renamed into Actions, these can be found as a Tab within the repository.
What these Actions end up translating to is a workflows directory within the .github directory within a specific repository.
Along with this blog there is a public RSS feed, so I knew I could easily request the blog article history to then process into Markdown.
I have used a basic node script to load in the existing Markdown file and then populate a list of articles between the two tag identifiers, this then writes the changes to disk, this can be run locally to test by doing yarn build, but in the next section you can then automate this using GitHub Actions and get it to automatically commit and push the changes.
The workflow script below, defines the workflow to be executed every 4 hours given by the cron schedule and will use ubuntu-latest and node 14 to execute the steps defined. Which will simply checkout the repository and install the required node dependancies and then run yarn build to update the README.md and then finally commit it authoring as a bot.
Everything you need to do this for yourself can be found in the repository below. To go from the basic markdown at the start of this article to the screenshot containing the dynamic content and even the build passing badge.