DEV Community

Cover image for 🚀 Elevate Your GitHub Profile with the Merged PRs GitHub Action
Parth Johri
Parth Johri

Posted on

🚀 Elevate Your GitHub Profile with the Merged PRs GitHub Action

Introduction

I am excited to share my newest project, Merged PRs GitHub Action, in the spirit of developing solid coding habits.

This project is designed to automatically track and display the number of merged pull requests in your GitHub repository, providing you with a visual representation of your contributions.

The project idea is inspired by github-activity-readme. However, there was a catch: the activity showed all closed, opened, commented, merged PRs/issues, and comments, without the option to specify which activities to showcase on the profile. This led me to create this simple project which makes use of a python script and GitHub Action to only update the Merged PRs on your profile.

By integrating this GitHub Action, you'll not only streamline your workflow but also gain valuable insights into your merged project's activity.

GitHub Merge PR Action

You can watch it in action on my GitHub Profile

Happy coding! 🚀

Step-by-Step Guide to Set Up GitHub Action for Merging PRs

How to Use?

  • Go to your Profile README repository and create the .github/workflows/action.yml file using the configuration provided in the GitHub Repository.
  • Add the main.py file from the GitHub Repository to your Profile README repository. Make sure to replace ParthJohri with your username in the following line:
   url = "https://api.github.com/search/issues?q=is:pr+author:ParthJohri+is:merged"
Enter fullscreen mode Exit fullscreen mode
  • Add the requirements.txt file from the GitHub Repository to your Profile README repository.
  • Ensure your Profile README.md contains the below comments, to show your merged PRs in your Profile ReadME:
<!--Start Count Merged PRs-->
  <span><img src="https://img.shields.io/badge/Total_Merged_PRs-34-1877F2?style=for-the-badge"></span>
<!--Finish Count Merged PRs-->

<!--Start Merged PRs-->
1. 🥳 Merged PR [379](https://github.com/pymc-labs/CausalPy/pull/379) - [pymc-labs/CausalPy](https://github.com/pymc-labs/CausalPy)
2. 🎉 Merged PR [11](https://github.com/monacodelisa/LGBTQ-definitions/pull/11) - [monacodelisa/LGBTQ-definitions](https://github.com/monacodelisa/LGBTQ-definitions)
3. 🎊 Merged PR [876](https://github.com/glasskube/glasskube/pull/876) - [glasskube/glasskube](https://github.com/glasskube/glasskube)
4. 🥂 Merged PR [7](https://github.com/monacodelisa/LGBTQ-definitions/pull/7) - [monacodelisa/LGBTQ-definitions](https://github.com/monacodelisa/LGBTQ-definitions)
5. 🙌🏼 Merged PR [5](https://github.com/monacodelisa/LGBTQ-definitions/pull/5) - [monacodelisa/LGBTQ-definitions](https://github.com/monacodelisa/LGBTQ-definitions)
<!--Finish Merged PRs-->
Enter fullscreen mode Exit fullscreen mode
  • By default the cron jobs runs every 6 hours or you can also manually start it. You can also make use of Cron Tab to change the cron job time as per your requirement.

Acknowledgements

Inspired by jamesgeorge007/github-activity-readme

Please star ⭐️ the repository if you liked this simple project and let me know of any suggestions to improve it.

Top comments (0)