Adding my Untappd Checkins to my GitHub Profile README

Jason Tucker
3 min readMay 9, 2022

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.

Goal

The idea was generating a simple table of my 3 most recent checkins on Untappd. I wanted that table to contain:

  1. A picture, if I took one.
  2. The name and brewery of the beer.
  3. 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.

  1. An all GitHub workflow version.
    This actually worked fairly well but the action I used for generating the table was very limited.
  2. Generate an image via Azure Function (or similar).
    This one I didn’t even start because I wanted to keep it all in GitHub
  3. 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.
  4. AsciiDoc generation with includes.
    This would have been great and my chosen solution. Unfortunately GitHub currently doesn’t support the include:: 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?

  1. Install dotnet 5
  2. Install the jq cli
  3. Get my 3 most recent checkins via curl. The url is tokenized for GitHub to inject my secrets into.
  4. Use jq to parse the JSON and extract the pieces I want
  5. Run my F# script to generate the updated README.asciidoc
  6. 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.
  1. Use the JSONProvider from F# Data package to generate types based on the parsed JSON
  2. Read in the entire README.asciidoc file
  3. Perform a Regex match to pull out all the text between // untappd beer and //untappd end markers
  4. Generate the HTML table from the checkins
  5. 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

--

--

Software Guy. Just took a DNA test turns out I’m 100% that guy that broke the build.