How to show recent GitHub activities on your profile readme
In this article, we will be discussing how to show our recent GitHub activities on our profile readme.

Search for a command to run...
In this article, we will be discussing how to show our recent GitHub activities on our profile readme.

No comments yet. Be the first to comment.
Every October, the developer community buzzes with Hacktoberfest energy. PRs fly, t-shirts are earned, and GitHub turns green. But here's what nobody talks about: what happens in November? For most contributors, the answer is simple: nothing. The rep...

The debate over AI coding agents is missing the most important factor. It’s not about prompt engineering, it’s about understanding the context window. Developers are divided. One side claims coding agents suck. The other insists you’re just using the...

Learnings from a Research Paper

Lately, I have been working on a feature to capture images from media streams and scale them down to reduce their size. This helps save storage and reduce costs before uploading the images to a storage service. For this, I used Canvas to render the i...

AI helps you do more, but only if you know the basics well enough to tell it what you want.

We all know Github is a great platform to collaborate with people and contribute to open source projects. daily, we do perform some activities on GitHub like creating an issue, creating a pull request, code review and all other things.
These are the activities that get added to our contributions and we get a green square for each day with our contributions counts.
For Example, contribution count graph like this,

When we click on any box we will get activities of that day something like this.

Here you can see my activities of date 10th October 2021, I created some commits and opened some issues.
Have you ever thought of showing your GitHub activities on your Profile Readme?
You will be thinking like is that even possible? yes, it is possible and today in this article, we will be discussing how to show our recent GitHub activities on our profile readme.
Let's get started.
We will be going to use Github Actions that will help us to create a workflow to show our recent activities on Profile readme.
before jumping into the setup let's first discuss what are GitHub actions and what they are used for.
GitHub actions are a set of events and workflow, whenever specified events happen to your GitHub repository it will run the associated workflow for it.
want to learn more about Github actions, you can get started from here
GitHub - Activity - Readme is a Github action that will update your profile readme with recent GitHub activity.
It is created by James George you can check his profile here
to work with this action we will need to set up a workflow that will be running automatically to update the profile readme with recent activities.
we can easily set up this workflow in our profile repository to capture and update profile readme with recent activities.
.github folder in your profile repository if it does not exist.> mkdir .github
workflows folder inside the .githubfolder if it does not exist.>mkdir .github/workflows
{workflowname}.yml file inside workflows folder.where you can replace workflow name with your workflow name. I will give the name update-readme.yml.
> update-readme.yml
after creating a workflow file add this content to it.
name: Update README
on:
schedule:
- cron: "*/5 * * * *" # Runs every 5 minutes.
jobs:
build:
runs-on: ubuntu-latest
name: Update this repo's README with recent activity
steps:
- uses: actions/checkout@v2
- uses: jamesgeorge007/github-activity-readme@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
COMMIT_MSG: "Updated README with recent activity"
MAX_LINES: 10
name
on
jobs
Let's discuss them one by one

here we are running this workflow on schedule using a cron job to run this workflow every 5 minutes automatically.
If you don't know much about cron syntax then this may be helpful for you The quick and simple editor for cron schedule expressions
here we are defining only one job that is build which will commit on our repository with the message Update this repo's README with recent activity.
for jobs, we will need to define what environment it will be running and we are running this job on ubuntu.
also, we will need to define what steps to use, something like this
- uses: actions/checkout@v2
- uses: jamesgeorge007/github-activity-readme@master
env is used for automatic token authentication. you don't need to worry about secrets.GITHUB_TOKEN will automatically get referred from your GitHub account.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if you notice we are using the with attribute for 2nd action that is jamesgeorge007/github-activity-readme@master
here we are providing 2 options COMMIT_MSG and MAX_LINES.
COMMIT_MSG - Commit message used while committing to the repository.
MAX_LINES - The most number of lines should populate in your readme file
Now, I hope we are clear with all the components of a workflow.
README.md file.# Recent Activity :zap:
<!--START_SECTION:activity-->
<!--END_SECTION:activity-->
Think of it like a block that will get replaced by your recent activities.
For Example :
# Recent Activity :zap:
<!--START_SECTION:activity-->
1. 🎉 Merged PR [#2197](https://github.com/open-metadata/OpenMetadata/pull/2197) in [open-metadata/OpenMetadata](https://github.com/open-metadata/OpenMetadata)
2. ❗️ Closed issue [#2040](https://github.com/open-metadata/OpenMetadata/issues/2040) in [open-metadata/OpenMetadata](https://github.com/open-metadata/OpenMetadata)
3. ❗️ Closed issue [#2028](https://github.com/open-metadata/OpenMetadata/issues/2028) in [open-metadata/OpenMetadata](https://github.com/open-metadata/OpenMetadata)
4. ❗️ Closed issue [#2156](https://github.com/open-metadata/OpenMetadata/issues/2156) in [open-metadata/OpenMetadata](https://github.com/open-metadata/OpenMetadata)
5. 🗣 Commented on [#2156](https://github.com/open-metadata/OpenMetadata/issues/2156) in [open-metadata/OpenMetadata](https://github.com/open-metadata/OpenMetadata)
6. 🎉 Merged PR [#2154](https://github.com/open-metadata/OpenMetadata/pull/2154) in [open-metadata/OpenMetadata](https://github.com/open-metadata/OpenMetadata)
7. ❗️ Closed issue [#2087](https://github.com/open-metadata/OpenMetadata/issues/2087) in [open-metadata/OpenMetadata](https://github.com/open-metadata/OpenMetadata)
8. ❗️ Opened issue [#2156](https://github.com/open-metadata/OpenMetadata/issues/2156) in [open-metadata/OpenMetadata](https://github.com/open-metadata/OpenMetadata)
9. ❗️ Opened issue [#2147](https://github.com/open-metadata/OpenMetadata/issues/2147) in [open-metadata/OpenMetadata](https://github.com/open-metadata/OpenMetadata)
10. ❗️ Closed issue [#1876](https://github.com/open-metadata/OpenMetadata/issues/1876) in [open-metadata/OpenMetadata](https://github.com/open-metadata/OpenMetadata)
<!--END_SECTION:activity-->
Example of my profile readme with recent activities

we discussed what are github actions and why they are used for.
we did set up the workflow to update our profile readme with recent activities.
And that’s it for this topic. Thank you for reading.