ripon-auto-commit 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,27 @@
1
+ const commitYml = `name: Daily Auto Commit
2
+
3
+ on:
4
+ schedule:
5
+ - cron: '0 ${cronHour} * * *'
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ commit:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ with:
14
+ ref: ${branch}
15
+
16
+ - name: Make multiple commits with random messages
17
+ run: |
18
+ MESSAGES=(${messages.map(m => `"${m}"`).join(" ")})
19
+ for i in {1..${commitsPerDay}}
20
+ do
21
+ echo "Commit $i at $(date)" >> activity.txt
22
+ git add activity.txt
23
+ RANDOM_MSG=\${MESSAGES[$RANDOM % ${messages.length}]}
24
+ git commit -m "\$RANDOM_MSG" || true
25
+ done
26
+ git push
27
+ `;
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Md Ripon Akondo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
File without changes
package/activity.txt ADDED
@@ -0,0 +1 @@
1
+ Start
package/bin/cli.js ADDED
@@ -0,0 +1,109 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fs from "fs-extra";
4
+ import path from "path";
5
+ import inquirer from "inquirer";
6
+ import fetch from "node-fetch";
7
+
8
+ // -------- CLI Prompt --------
9
+ const answers = await inquirer.prompt([
10
+ {
11
+ type: "number",
12
+ name: "commitsPerDay",
13
+ message: "How many commits per day do you want?",
14
+ default: 1
15
+ },
16
+ {
17
+ type: "input",
18
+ name: "commitTime",
19
+ message: "Enter commit hour in 24h format (0-23, Bangladesh time):",
20
+ default: "0"
21
+ },
22
+ {
23
+ type: "confirm",
24
+ name: "useAIQuote",
25
+ message: "Do you want optional AI-generated quotes?",
26
+ default: true
27
+ },
28
+ {
29
+ type: "input",
30
+ name: "branch",
31
+ message: "Which branch do you want the auto commit on?",
32
+ default: "main"
33
+ }
34
+ ]);
35
+
36
+ const { commitsPerDay, commitTime, useAIQuote, branch } = answers;
37
+
38
+
39
+ // -------- Random Messages --------
40
+ const baseMessages = [
41
+ "💻 Coding hard",
42
+ "🚀 Learning daily",
43
+ "🔥 Building future",
44
+ "🤖 Keep grinding",
45
+ "📚 Practice makes perfect"
46
+ ];
47
+
48
+ // -------- AI Quote Function --------
49
+ async function getAIQuote() {
50
+ try {
51
+ const res = await fetch("https://api.quotable.io/random");
52
+ const data = await res.json();
53
+ return `💡 ${data.content} — ${data.author}`;
54
+ } catch (err) {
55
+ return "💡 Keep pushing forward!";
56
+ }
57
+ }
58
+
59
+ // -------- Prepare Messages --------
60
+ let messages = [...baseMessages];
61
+
62
+ if (useAIQuote) {
63
+ const aiQuote = await getAIQuote();
64
+ messages.push(aiQuote);
65
+ }
66
+
67
+ // -------- File Paths --------
68
+ const repoPath = process.cwd();
69
+ fs.ensureDirSync(path.join(repoPath, ".github/workflows"));
70
+
71
+ // -------- commit.yml --------
72
+ const cronTimeUTC = (parseInt(commitTime) - 6 + 24) % 24;
73
+ const cronHour = cronTimeUTC;
74
+
75
+ const commitYml = `name: Daily Auto Commit
76
+
77
+ on:
78
+ schedule:
79
+ - cron: '0 ${cronHour} * * *'
80
+ workflow_dispatch:
81
+
82
+ jobs:
83
+ commit:
84
+ runs-on: ubuntu-latest
85
+ steps:
86
+ - uses: actions/checkout@v4
87
+
88
+ - name: Make multiple commits with random messages
89
+ run: |
90
+ MESSAGES=(${messages.map(m => `"${m}"`).join(" ")})
91
+ for i in {1..${commitsPerDay}}
92
+ do
93
+ echo "Commit $i at $(date)" >> activity.txt
94
+ git add activity.txt
95
+ RANDOM_MSG=\${MESSAGES[$RANDOM % ${messages.length}]}
96
+ git commit -m "\$RANDOM_MSG" || true
97
+ done
98
+ git push
99
+ `;
100
+
101
+ // -------- Write Files --------
102
+ fs.writeFileSync(path.join(repoPath, ".github/workflows/commit.yml"), commitYml);
103
+ fs.writeFileSync(path.join(repoPath, "activity.txt"), "Start\n");
104
+
105
+ console.log("✅ GitHub auto commit workflow setup complete!");
106
+ console.log("1. Commit and push these files");
107
+ console.log("2. Enable GitHub Actions read/write permissions");
108
+ console.log("3. Done, auto daily commit will run!");
109
+ console.log("4. AI-generated commit messages included!");
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "ripon-auto-commit",
3
+ "version": "1.0.3",
4
+ "description": "CLI tool to setup GitHub daily commit automation with random messages, multiple commits, custom time, and optional AI quotes",
5
+ "bin": {
6
+ "ripon-auto-commit": "bin/cli.js"
7
+ },
8
+ "private": false,
9
+ "dependencies": {
10
+ "fs-extra": "^11.3.3",
11
+ "inquirer": "^9.3.8",
12
+ "node-fetch": "^3.3.2"
13
+ },
14
+ "type": "module"
15
+ }