Skip to content

Commit 01d7aff

Browse files
committed
feat: Enhance README with details and workflow diagram
1 parent 5417421 commit 01d7aff

File tree

2 files changed

+84
-36
lines changed

2 files changed

+84
-36
lines changed

README.md

Lines changed: 84 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,97 @@
1-
# 🌱 goGreen
1+
# 🤖 GitHub Contribution Graph Enhancer (goGreen Fork)
22

3-
With **goGreen**, you can make your profile look like you've been hard at work... even if you haven't.
4-
NodeJs script to make commits to the past (or the future) to go green on GitHub.
3+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](/LICENSE) [![Node.js CI](https://github.com/Dynamo14324/github-bot/actions/workflows/node.js.yml/badge.svg)](https://github.com/Dynamo14324/github-bot/actions/workflows/node.js.yml) <!-- Placeholder CI Badge -->
54

6-
## About
5+
Ever wished your GitHub contribution graph looked a bit more... active? Or maybe you want to create some pixel art on your profile? This script, originally inspired by **goGreen**, lets you make commits dated in the past (or future!), effectively painting your contribution graph green.
76

8-
**goGreen** helps you create commits on your GitHub profile for any date in the past. Whether you want to fill up your contribution graph or even make cool patterns and artwork.
7+
**Disclaimer:** This tool is intended for creative expression and personal use (e.g., filling in legitimate gaps from offline work, creating profile art). Using it to misrepresent your activity level is discouraged.
98

10-
## Getting Started
9+
## ✨ Features
1110

12-
Follow these steps to bring your contribution graph to life:
11+
* **Backdate Commits:** Create commits for any date to fill your GitHub contribution graph.
12+
* **Simple Setup:** Easy to configure and run with Node.js.
13+
* **Customizable:** Modify the script to control commit frequency and patterns.
14+
* **Creative Potential:** Design patterns or artwork on your contribution graph.
1315

14-
1. **Clone this repository**
15-
```bash
16-
git clone https://github.com/fenrir2608/goGreen.git
17-
cd goGreen
18-
```
19-
3. **Set up your project**
20-
Initialize a new Node.js project:
21-
```bash
22-
npm init -y
23-
```
24-
3. **Install the required npm modules**
25-
You'll need a few modules to get everything running smoothly. Install them all with:
26-
```bash
27-
npm install moment simple-git random
28-
```
29-
4. **Create your commit script**
30-
- Create a JavaScript file to manage your commits.
31-
- Create a JSON file to store all the commit timestamp data.
16+
## 🚀 Getting Started
3217

33-
## Room for Improvement
18+
Follow these steps to get started:
3419

35-
So, you've got the basics down. What's next?
20+
1. **Clone this Repository:**
21+
```bash
22+
git clone https://github.com/Dynamo14324/github-bot.git
23+
cd github-bot
24+
```
3625

37-
- **Custom Patterns:** Experiment with different patterns on your contribution graph. Maybe spell out your name or create some cool designs.
38-
- **Density Control:** Play around with the number of commits per day to adjust the shades of green.
39-
- **Input Strings:** Convert input strings to X-Y mapped contributions.
26+
2. **Install Dependencies:**
27+
Make sure you have Node.js installed. Then run:
28+
```bash
29+
npm install
30+
```
31+
This installs the necessary packages (`moment`, `simple-git`, `jsonfile`, `random`).
4032

41-
## npm Modules Used
33+
3. **Configure Your Repository:**
34+
* This script makes commits *within the cloned repository itself* (`github-bot`).
35+
* Ensure you have set your Git user name and email globally or locally for this repository:
36+
```bash
37+
git config user.name "Your Name"
38+
git config user.email "[email protected]"
39+
```
40+
* **Important:** The script modifies the `data.json` file with each commit. You need to push these changes to *this* repository (`Dynamo14324/github-bot`) for the contributions to appear on your profile graph associated with this repo.
4241

43-
- [`moment`](https://www.npmjs.com/package/moment) - Handles date and time manipulation.
44-
- [`simple-git`](https://www.npmjs.com/package/simple-git) - For easy Git commands.
45-
- [`random`](https://www.npmjs.com/package/random) - To generate random numbers for the commits.
42+
4. **Run the Script:**
43+
Execute the script to start making backdated commits:
44+
```bash
45+
node index.js
46+
```
47+
The script will output the dates for which it is creating commits.
4648

47-
## Credits
49+
5. **Push Your Changes:**
50+
After the script finishes (or periodically), push the changes made to `data.json` back to GitHub:
51+
```bash
52+
git add data.json
53+
git commit -m "feat: Update contribution data" # Or any commit message
54+
git push origin main # Or your default branch
55+
```
56+
Allow some time for GitHub to update your contribution graph.
57+
58+
## ⚙️ How It Works
59+
60+
Here's a simplified view of the script's workflow:
61+
62+
![Workflow Diagram](./workflow_diagram.png)
63+
64+
The `index.js` script uses:
65+
* `moment` to handle date calculations.
66+
* `jsonfile` to read/write commit timestamps to `data.json`.
67+
* `simple-git` to execute Git commands programmatically (commit).
68+
* `random` to generate random dates within a specified range (typically the past year).
69+
70+
For each generated date, it modifies the `data.json` file and creates a commit with that specific date using Git environment variables (`GIT_COMMITTER_DATE` and `GIT_AUTHOR_DATE`).
71+
72+
## 🎨 Customization & Ideas
73+
74+
* **Commit Frequency:** Modify the loop in `index.js` (e.g., the `ITERATION` constant) to control how many commits are generated.
75+
* **Date Range:** Adjust the `DATE` calculation using `moment` to target specific periods.
76+
* **Pattern Generation:** Instead of random dates, implement logic to generate dates corresponding to specific patterns or images on the contribution graph.
77+
* **Target Different Repos:** Adapt the script to make commits in a *different* repository if desired (requires careful path management and Git initialization in the target repo).
78+
79+
## 🤝 Contributing
80+
81+
Contributions, issues, and feature requests are welcome!
82+
83+
1. Fork the Project
84+
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
85+
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
86+
4. Push to the Branch (`git push origin feature/AmazingFeature`)
87+
5. Open a Pull Request
88+
89+
## 📜 License
90+
91+
Distributed under the MIT License. See `LICENSE` for more information.
92+
93+
## 🙏 Acknowledgements
94+
95+
* Original concept inspired by Akshay Saini's video tutorial.
96+
* Libraries: `moment`, `simple-git`, `jsonfile`, `random`.
4897
49-
Huge thanks to [Akshay Saini](https://github.com/akshaymarch7) for the original video behind this project.

workflow_diagram.png

1.43 MB
Loading

0 commit comments

Comments
 (0)