Skip to content

Commit 8b7959b

Browse files
committed
docs: Enhance README and add CONTRIBUTING guide
1 parent 852b92d commit 8b7959b

File tree

2 files changed

+73
-39
lines changed

2 files changed

+73
-39
lines changed

CONTRIBUTING.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Contributing to GitHub Contribution Graph Enhancer
2+
3+
Thank you for considering contributing to this project! We welcome contributions from the community.
4+
5+
## How to Contribute
6+
7+
1. **Fork the Repository:** Click the 'Fork' button at the top right of the repository page.
8+
2. **Clone Your Fork:** `git clone https://github.com/YOUR_USERNAME/github-bot.git`
9+
3. **Create a Branch:** `git checkout -b feature/your-feature-name` or `bugfix/issue-description`
10+
4. **Make Your Changes:** Implement your feature or fix the bug.
11+
5. **Test Your Changes:** Ensure your changes work as expected and do not introduce new issues.
12+
6. **Commit Your Changes:** Write clear and concise commit messages. `git commit -m "feat: Add feature X"` or `fix: Resolve issue Y`
13+
7. **Push to Your Fork:** `git push origin feature/your-feature-name`
14+
8. **Open a Pull Request:** Go to the original repository and open a pull request from your fork's branch to the `main` branch of the original repository.
15+
16+
## Reporting Issues
17+
18+
If you find a bug or have a suggestion, please open an issue on the GitHub repository. Provide as much detail as possible, including:
19+
20+
* Steps to reproduce the issue.
21+
* Expected behavior.
22+
* Actual behavior.
23+
* Screenshots (if applicable).
24+
* Your environment details (OS, Node.js version).
25+
26+
## Code Style
27+
28+
Please try to follow the existing code style. If you add new dependencies, update the `package.json` file accordingly.
29+
30+
We appreciate your contributions!

README.md

Lines changed: 43 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
11
# 🤖 GitHub Contribution Graph Enhancer (goGreen Fork)
22

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 -->
3+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](/LICENSE)
4+
[![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)
5+
[![GitHub Stars](https://img.shields.io/github/stars/dynamo14324/github-bot?style=social)](https://github.com/Dynamo14324/github-bot/stargazers)
6+
[![GitHub Forks](https://img.shields.io/github/forks/dynamo14324/github-bot?style=social)](https://github.com/Dynamo14324/github-bot/network/members)
7+
[![Contributions Welcome](https://img.shields.io/badge/Contributions-Welcome-brightgreen.svg?style=flat)](CONTRIBUTING.md)
48

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.
9+
Ever wished your GitHub contribution graph looked a bit more... active? Or perhaps you want to create some pixel art on your profile? This Node.js script, originally inspired by **goGreen**, allows you to programmatically create commits dated in the past (or future!), effectively painting your contribution graph green.
610

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.
11+
**Important Disclaimer:** This tool is primarily intended for creative expression and personal use cases, such as:
12+
* Filling in legitimate contribution gaps from offline work or private repositories.
13+
* Creating pixel art or patterns on your GitHub profile graph.
14+
* Learning about Git internals and scripting.
15+
16+
Using this tool solely to misrepresent your activity level or inflate contribution metrics is strongly discouraged and goes against the spirit of open source collaboration.
817

918
## ✨ Features
1019

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.
20+
* **Backdate Commits:** Create commits for any past date to fill your GitHub contribution graph.
21+
* **Simple Setup:** Easy to configure and run using Node.js and npm.
22+
* **Customizable:** Modify the script to control commit frequency, date ranges, and patterns.
23+
* **Creative Potential:** Design unique patterns or artwork on your contribution graph.
24+
* **Repository Specific:** Commits are made within the cloned repository, targeting `data.json`.
1525

1626
## 🚀 Getting Started
1727

18-
Follow these steps to get started:
28+
Follow these steps to get the script running:
1929

2030
1. **Clone this Repository:**
2131
```bash
@@ -24,74 +34,68 @@ Follow these steps to get started:
2434
```
2535

2636
2. **Install Dependencies:**
27-
Make sure you have Node.js installed. Then run:
37+
Ensure you have Node.js (v14 or later recommended) and npm installed. Then run:
2838
```bash
2939
npm install
3040
```
31-
This installs the necessary packages (`moment`, `simple-git`, `jsonfile`, `random`).
41+
This installs the necessary packages: `moment`, `simple-git`, `jsonfile`, and `random`.
3242

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:
43+
3. **Configure Git:**
44+
* The script makes commits *within this cloned repository* (`github-bot`).
45+
* Set your Git user name and email locally for this repository (or ensure they are set globally):
3646
```bash
3747
git config user.name "Your Name"
3848
git config user.email "[email protected]"
3949
```
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.
50+
* **Crucial Step:** The script modifies the `data.json` file with each generated commit. You **must** push these changes back to *this* repository (`Dynamo14324/github-bot` or your fork) for the contributions to appear on your profile graph associated with this specific repo.
4151

4252
4. **Run the Script:**
43-
Execute the script to start making backdated commits:
53+
Execute the script to start generating backdated commits:
4454
```bash
4555
node index.js
4656
```
47-
The script will output the dates for which it is creating commits.
57+
The console will output the dates for which commits are being created.
4858

4959
5. **Push Your Changes:**
50-
After the script finishes (or periodically), push the changes made to `data.json` back to GitHub:
60+
After the script finishes (or periodically if running for a long time), push the accumulated changes in `data.json` back to GitHub:
5161
```bash
5262
git add data.json
53-
git commit -m "feat: Update contribution data" # Or any commit message
63+
git commit -m "chore: Update contribution data" # Example commit message
5464
git push origin main # Or your default branch
5565
```
56-
Allow some time for GitHub to update your contribution graph.
66+
Allow some time (usually minutes) for GitHub to process the commits and update your contribution graph.
5767

5868
## ⚙️ How It Works
5969

60-
Here's a simplified view of the script's workflow:
70+
The core logic resides in `index.js`. Here’s a breakdown:
6171

6272
![Workflow Diagram](./workflow_diagram.png)
6373

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`).
74+
1. **Initialization:** Loads dependencies (`moment`, `simple-git`, `jsonfile`, `random`).
75+
2. **Date Generation:** Uses `random.choice` and `moment` to pick random dates within the last year (or as configured).
76+
3. **File Modification:** Reads `data.json`, updates a timestamp or counter within it, and writes the file back.
77+
4. **Git Commit:** Uses `simple-git` to stage `data.json` and create a commit. Crucially, it sets the `GIT_COMMITTER_DATE` and `GIT_AUTHOR_DATE` environment variables for the commit command, effectively backdating it.
78+
5. **Looping:** Repeats the process for a defined number of iterations (e.g., `ITERATION` constant).
7179

7280
## 🎨 Customization & Ideas
7381

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).
82+
* **Commit Frequency:** Modify the loop or `ITERATION` constant in `index.js` to control the number of commits.
83+
* **Date Range:** Adjust the `DATE` calculation logic using `moment` to target specific historical periods or even future dates.
84+
* **Pattern Generation:** Replace the random date generation with logic to create specific shapes or text on your contribution graph. This requires mapping desired pixels to specific dates.
85+
* **Target Different Repos:** Adapt the script to operate on a *different* local repository. This would involve changing the working directory for `simple-git` and ensuring that repository is properly initialized and configured.
7886

7987
## 🤝 Contributing
8088

81-
Contributions, issues, and feature requests are welcome!
89+
Contributions are highly welcome! Whether it's fixing bugs, improving documentation, or adding new features, your help is appreciated.
8290
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
91+
Please read our [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to contribute.
8892
8993
## 📜 License
9094
9195
Distributed under the MIT License. See `LICENSE` for more information.
9296
9397
## 🙏 Acknowledgements
9498
95-
* Original concept inspired by Akshay Saini's video tutorial.
96-
* Libraries: `moment`, `simple-git`, `jsonfile`, `random`.
99+
* Original concept inspired by similar projects and tutorials (like goGreen).
100+
* Essential Libraries: `moment`, `simple-git`, `jsonfile`, `random`.
97101

0 commit comments

Comments
 (0)