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.
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 ProfileREADME
repository. Make sure to replaceParthJohri
with your username in the following line:
url = "https://api.github.com/search/issues?q=is:pr+author:ParthJohri+is:merged"
- Add the
requirements.txt
file from the GitHub Repository to your ProfileREADME
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 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 (2)
Great write-up, we have a bunch of articles on Github Actions in our Newsletter, check it out - packagemain.tech/p/github-actions-...
Thank you @plutov , would surely check the articles!