🚀 Elevate Your GitHub Profile with the Merged PRs GitHub Action
Tags: github, githubactions, beginners, 100daysofcode
Published: 2024-06-28 08:36:06

## Introduction

I am excited to share my newest project, [Merged PRs GitHub Action](https://github.com/ParthJohri/github-mergedpr-readme), 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](https://github.com/jamesgeorge007/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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/na744u6vqb8x9942trrb.png)

You can watch it in action on my [GitHub Profile](https://github.com/ParthJohri/ParthJohri)

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](https://github.com/ParthJohri/github-mergedpr-readme).
- Add the `main.py` file from the [GitHub Repository](https://github.com/ParthJohri/github-mergedpr-readme) to your Profile `README` repository. Make sure to replace `ParthJohri` with your username in the following line:
   ```python
   url = "https://api.github.com/search/issues?q=is:pr+author:ParthJohri+is:merged"
   ```
- Add the `requirements.txt` file from the [GitHub Repository](https://github.com/ParthJohri/github-mergedpr-readme) 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-->
```
- By default the cron jobs runs every 6 hours or you can also manually start it. You can also make use of [Cron Tab](https://crontab.guru/) to change the cron job time as per your requirement.

## Acknowledgements
<i>Inspired by [jamesgeorge007/github-activity-readme](https://github.com/jamesgeorge007/github-activity-readme)</i>

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