DEV Community

Cover image for How to create a self-updating Github Profile
Kelvin Chu
Kelvin Chu

Posted on

How to create a self-updating Github Profile

Recently, there is a new feature on Github - a profile page for user:

RageBill's Github Profile

There are a ton of other posts about how to create a Github profile and all that, so I am not going to write a step-by-step guides here.

Instead, I am trying to explain how does a self-updating
Github Profile works.

Taking my own profile as an example, I use PokéAPI to fetch and display name and picture of a random gen 1 pokemon. The profile updates once every hour by itself.

So, how does it work? Let me try to explain it as simply as possible.

Special Repository For Github Profile

First, Github has now reserved a special repository for your profile - YOUR_USERNAME/YOUR_USERNAME. In my case, it would be RageBill/RageBill. If you create a file in that repository, you will then see a button in your repository to display it on your profile page like this:

Github Profile Page Button

Ok, now that you know where is the source of the profile page, let's talk about how to make it self-updating.

Writing Script To Generate

For me, I have created a script in Python to generate a for me: content

To explain the script, it randomize a number between 1 to 151 (id of gen 1 pokemon), use that id to fetch data from PokéAPI, then write the result into a file.

Use Github Action To Update The Repository

Once we have a script, the only thing we have to do is to make it update itself. The easiest way is to use Github Action.

For me, I have set it up with this yml file.

To highlight, there are two parts that make this work:

main.yml content 1

This parts tells Github Action to run the code on 1) push to master, and 2) once every hour.

Then, after running the script, the profile won't update by itself yet. You have to make it commit the generated:

main.yml content 2

And that's it!

To Recap:

  • There is a special repo YOUR_USERNAME/YOUR_USERNAME for your Github Profile.
  • Write a script in any language (I used Python here) to generate a for you.
  • Configure Github Action to run the script for you.
  • Don't forget to let Github Action commit the change to your repository.
  • You can schedule the Github Action with cron to make the profile update by itself on a constant interval.

Happy coding!


Go automate your GitHub profile README
Awesome Github Profile README

Discussion (1)

waylonwalker profile image
Waylon Walker

I love the personal touch and dynamicness that this adds to your profile.

I recently found the git-auto-commit-action action super simple to make commits on my behalf.

GitHub logo stefanzweifel / git-auto-commit-action

Automatically Commit changed Files back to Github with Github Actions

git-auto-commit Action

The GitHub Action for committing files for the 80% use case.

This GitHub Action automatically commits files which have been changed during a Workflow run and pushes the commit back to GitHub.
The default committer is "GitHub Actions", and the default author of the commit is "Your GitHub Username github_username@users.noreply.gith...".

This Action has been inspired and adapted from the auto-commit-Action of the Canadian Digital Service and this commit-Action by Eric Johnson.


Add the following step at the end of your job, after other steps that might add or change files.

- uses: stefanzweifel/git-auto-commit-action@v4
    # Required
    commit_message: Apply automatic changes
    # Optional branch to push to, defaults to the current branch
    branch: feature-123
    # Optional options appended to `git-commit`
    # See for a list of available options
    commit_options: '--no-verify --signoff'
    # Optional glob pattern