

Adding my Untappd Checkins to my GitHub Profile README
source link: https://codingfor.beer/adding-my-untappd-checkins-to-my-github-profile-readme-4a7ee8043a1d
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Adding my Untappd Checkins to my GitHub Profile README
Recently, I wanted to give my GitHub Profile README a little sprucing up. In what probably took longer than it should, I decided I wanted to include my Untappd checkins at the bottom of the page.
I’m actually quite embarrassed in how long it took me to decide that, seeing how this blog is called “Coding for Beer”.
I ended up using a combo of GitHub Actions and a simple F# script to get the work done.
The idea was generating a simple table of my 3 most recent checkins on Untappd. I wanted that table to contain:
- A picture, if I took one.
- The name and brewery of the beer.
- The rating I gave it.
Here I would like to list out the first couple iterations of this solution before finally selecting the one I’m currently using.
- An all GitHub workflow version.
This actually worked fairly well but the action I used for generating the table was very limited. - Generate an image via Azure Function (or similar).
This one I didn’t even start because I wanted to keep it all in GitHub - Use some sort of templating engine to output the AsciiDoc/Markdown.
I found the current state of cli based template engines to be lacking. Also, I didn’t put much time into researching this past a few hours of google-bing. - AsciiDoc generation with includes.
This would have been great and my chosen solution. Unfortunately GitHub currently doesn’t support theinclude::
statement at the moment.
Solution
tl;dr I ended up using GitHub actions to download and parse my Untappd activity. From there I used an F# script to read in the data, generate the table HTML and output the updated file.
First I needed to create an app registration over on Untappd. That is done on this site.
Once that was approved I was given a Client ID
and a Client Secret
to use later to make authenticated calls to pull my activity from the site.
I then created two repository secrets in my profile repo lat look like this:

I then created a new workflow called untappd.yaml
in the .github/workflows
folder in my repo.
So what happens here?
- Install dotnet 5
- Install the jq cli
- Get my 3 most recent checkins via
curl
. The url is tokenized for GitHub to inject my secrets into. - Use jq to parse the JSON and extract the pieces I want
- Run my F# script to generate the updated
README.asciidoc
- Commit the updated file if necessary. The secret is to make sure that
skip_dirty_check
is set to false, otherwise it will always commit and mess up my history.
- Use the JSONProvider from F# Data package to generate types based on the parsed JSON
- Read in the entire
README.asciidoc
file - Perform a Regex match to pull out all the text between
// untappd beer
and//untappd end
markers - Generate the HTML table from the checkins
- Finally, update the
README.asciidoc
with the (possibly) new content
All in all the process was pretty smooth. I especially loved that the stefanzweifel/git-auto-commit-action had built into functionality to not commit a file that hasn’t been updated. Another thing that helped during the process of putting this together was the act testing tool that allowed me to debug my workflow locally. I really wish there was one of these for Azure Pipelines.
Here is an example of the final product:

Originally published 2021–03–11 on an older version of this blog
Recommend
-
19
Github 新玩法 -- Profile ReadMe Intro 今天刷 Github 的时候偶然发现一个新的玩法,Github Profile ReadMe,可以在个人的 Profile 页面展示一个自定义的 ReadMe 操作步骤 新建仓库
-
14
GitHub quietly released a new feature at some point in the past few days: profile READMEs. Create a repository with the same name as your GitHub account (in my case that’s githu...
-
7
How to use GitHub actions and Contentful webhooks to show your latest blog posts on your GitHub profile READMEIf you push code to GitHub and share it with the public, chances are that someone will stumble across your GitHub profile....
-
7
-
4
Kije Park Posted on Oct 29...
-
6
Introduction By creating a repository with the same name as your GitHub username (eg. bobbyiliev/bobbyiliev) you actually create a special repository. Its README.md will appear on your public profile. In...
-
4
-
6
Ranked #18 for today
-
2
Adding custom HTML and CSS to GitHub READMEPublished December 13, 2022Last updated December 13, 2022loading views
-
4
My BadgesGitHub badges for profile README.mdEver wished for more GitHub achievement badges? We did too! Join our community project where you can suggest, design, and vote on uniqu...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK