Make your GitHub Profile shine with dynamic updates

Posted by Carles Loriente on January 25, 2025 · 8 mins read
Updated on January 31, 2025

GitHub Profile Automation: Level Up Your Game with GitHub Actions

Introduction

Your GitHub profile is your digital resume. It showcases your skills, projects, and contributions to the community. However, keeping it up-to-date can be time-consuming and often leads to outdated information. Using GitHub Actions, you can automate the display of your latest contributions, project statistics, blog articles and more. Keeping your profile fresh and relevant with automated updates.

GitHub Profile with dynamic content

GitHub Profile README

To get started, we need a GitHub repository with the same name as your GitHub username. The GitHub profile is a special repository that allows you to showcase your skills, projects, and contributions. By creating a custom README file. You can add content to your profile page, such as an introduction, links to your social media profiles, and a list of your projects.

Create a new repository if you don’t have one

  1. Go to GitHub and click the + icon in the top right corner and select New repository.
  2. Enter the repository name carlesloriente/carlesloriente (replace carlesloriente with your GitHub username).
  3. Select Public as the visibility option and check the box Initialize this repository with a README. Click Create repository.
  4. Clone the repository to your local machine and create a new branch named main and push it to the remote repository:

git clone git@github.com:carlesloriente/carlesloriente
cd carlesloriente
git checkout -b main
git push origin main

Create a GitHub profile README

You can use markdown syntax in the README file that will be displayed on your profile page.

Edit the README.md file and add the following content:


## Check my latest articles 👋

<!-- BLOG-POST-LIST:START -->
<!-- BLOG-POST-LIST:END -->

This includes a heading and a placeholder to put the articles from your blog.

Save the file and commit the changes to the repository.


git add README.md
git commit -m 'Add README.md'
git push origin main

Go to your GitHub profile page and you will see the README file displayed.

Update file content automatically

Let’s set a GitHub Action workflow that runs on a schedule. This workflow will fetch data from our personal blog and update the README file with the latest posts.

1.- Make a new folder named .github/workflows in the root of your repository.


mkdir -p .github/workflows

2.- Create a new file named update-readme.yml in the .github/workflows folder.


touch .github/workflows/update-readme.yml

3.- Add the following content to the update-readme.yml file:


name: Update README
on:
  schedule:
    - cron: "0 * * * *"
  workflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the GitHub Actions Workflow page directly
permissions:
  contents: write

jobs:
  update-readme-with-blog:
    name: Update README with latest blog posts
    runs-on: ubuntu-24.04
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Pull in notesoncloudcomputing.com posts
        uses: gautamkrishnar/blog-post-workflow@v1
        with:
          feed_list: "https://www.notesoncloudcomputing.com/feed.xml"

The gautamkrishnar/blog-post-workflow action created by Gautam krishna fetches the latest blog posts from a feed URL and updates the file with post titles and links.

Remember to replace the feed_list value with the URL of your blog feed.

4.- Commit the changes:


git add .github/workflows/update-readme.yml
git commit -m "Add update-readme.yml"
git push origin main

Configure GitHub Actions permissions

Go to repository settings, Click on Actions-> General and enable the following permissions:

  • Click the checkbox “Read and write permissions” button.
  • Click the checkbox “Allow Github Actions to create and approve pull requests”.

And click on the “Save changes” button.

Repository permissions

Workflow explanation

  • The workflow is triggered every hour using the cron syntax 0 * * * *, and also includes a manual trigger using workflow_dispatch.
  • The actions/checkout@v4 action is used to check out the repository.
  • The gautamkrishnar/blog-post-workflow@v1 action is used to fetch the information.
  • The feed_list specifies the URL of the feed.
  • The permissions section grants write access to the contents of the repository.

Testing the workflow

Go to the Actions tab of your repository and you will see the workflow Update README running, or you can trigger it manually by clicking the Run workflow button.

After the workflow finishes, go to the main branch of your repository and you the README file will be updated with the latest blog posts list.

Updated README file

Bonus: GitHub Stats

You can also add your GitHub stats to your profile README. This includes your GitHub activity, top languages, and more. The anuraghazra/github-readme-stats action created by Anurag Hazra fetches the data from the GitHub API and generates a dynamic image that you can include in your README file.

GitHub stats

Add GitHub Stats to your profile

Edit the README.md file and add the following content:


## GitHub Stats
[![My Stats](https://github-readme-stats.vercel.app/api?username=myusername)](https://github.com/anuraghazra/github-readme-stats)

Replace myusername with your GitHub username.

Save and commit the changes to the repository.


git add README.md
git commit -m 'Add GitHub stats'
git push origin main

Now, your GitHub profile page will show the GitHub stats.

Conclusion

Enhancing your GitHub profile with dynamic updates brings several advantages. It showcases your latest contributions, projects, or blog posts, making your profile more engaging and informative. By automating the update process, you save time and effort, ensuring that your profile is always up-to-date.

If you found this valuable, consider starring the project’s consider starring the project’s GitHub repository 🌟. Share this knowledge with your network by spreading the word about this post! 🌍

Thanks for reading! 🚀

What’s Next?

  • Customize your GitHub profile with additional features and integrations.
  • Explore other GitHub Actions workflows to automate different tasks.
  • Share your GitHub profile with the community and receive feedback.
  • Stay updated with the latest GitHub Actions updates and best practices.

Additional Resources

Tags:#github-profile#github-actions#automation#profile#github-stats


Found a snippet that saved your day? Consider dropping a tip!