{"_id":"@btcxs/autogreen","name":"@btcxs/autogreen","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@btcxs/autogreen","version":"1.0.0","description":"自动保持 GitHub 提交状态常绿。","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"ISC","_id":"@btcxs/autogreen@1.0.0","gitHead":"05db77a6a8486ac978a31bc75444b37fc1d9ed3b","_nodeVersion":"20.9.0","_npmVersion":"10.3.0","dist":{"integrity":"sha512-m8NvAbOq1Ptb2lZiNmLgd8G7H+DNQsrMcf70e8HIc0IfZKmotkWBGj4M0JMtXxK0lTGW2YeIABOXbbzs0GcaNQ==","shasum":"194cdcbb9b8d887a10f5aafb0bd1a66e488a765d","tarball":"https://registry.npmjs.org/@btcxs/autogreen/-/autogreen-1.0.0.tgz","fileCount":7,"unpackedSize":32483,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICsDXQuN0lnIibwzai0qmEsfDQuZpJT5gQ7/3mPNGAMSAiEA+APTbE08SUPrlOy6ieADxTNCcbwU3QWLGJheYvfRlbg="}]},"_npmUser":{"name":"btcxs","email":"btcabc@163.com"},"directories":{},"maintainers":[{"name":"btcxs","email":"btcabc@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/autogreen_1.0.0_1708619329719_0.9306093554784043"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-22T16:28:49.643Z","1.0.0":"2024-02-22T16:28:49.976Z","modified":"2024-02-22T16:28:50.464Z"},"maintainers":[{"name":"btcxs","email":"btcabc@163.com"}],"description":"自动保持 GitHub 提交状态常绿。","license":"ISC","readme":"# auto-green\n自动保持 GitHub 提交状态常绿。\n\n> a commit a day keeps your girlfriend away.\n\n## 原理\n\n使用 GitHub Actions 的定时任务功能，每隔一段时间自动执行 `git commit`，提交信息为 \"a commit a day keeps your girlfriend away\"，灵感来自知乎问题[在 GitHub 上保持 365 天全绿是怎样一种体验？](https://www.zhihu.com/question/34043434/answer/57826281)下某匿名用户的回答：\n\n> 曾经保持了 200 多天全绿，但是冷落了女朋友，一直绿到现在。\n\n## 使用\n\n- 点右上角 **Use this template** 按钮复制本 GitHub 仓库，**:warning: 千万不要 Fork，因为 fork 项目的动态并不会让你变绿 :warning:**\n- 修改 [ci.yml 文件的第 19、20 行](https://github.com/AndersonHJB/AutoGreen/blob/master/.github/workflows/ci.yml#L19) 为自己的 GitHub 账号和昵称\n- (可选) 你可以通过修改 [ci.yml 文件的第 8 行](https://github.com/AndersonHJB/AutoGreen/blob/master/.github/workflows/ci.yml#L8)来调整频率\n\n计划任务语法有 5 个字段，中间用空格分隔，每个字段代表一个时间单位。\n\n```plain\n┌───────────── 分钟 (0 - 59)\n│ ┌───────────── 小时 (0 - 23)\n│ │ ┌───────────── 日 (1 - 31)\n│ │ │ ┌───────────── 月 (1 - 12 或 JAN-DEC)\n│ │ │ │ ┌───────────── 星期 (0 - 6 或 SUN-SAT)\n│ │ │ │ │\n│ │ │ │ │\n│ │ │ │ │\n* * * * *\n```\n\n每个时间字段的含义：\n\n|符号   | 描述        | 举例                                        |\n| ----- | -----------| -------------------------------------------|\n| `*`   | 任意值      | `* * * * *` 每天每小时每分钟                  |\n| `,`   | 值分隔符    | `1,3,4,7 * * * *` 每小时的 1 3 4 7 分钟       |\n| `-`   | 范围       | `1-6 * * * *` 每小时的 1-6 分钟               |\n| `/`   | 每         | `*/15 * * * *` 每隔 15 分钟                  |\n\n**注**：由于 GitHub Actions 的限制，如果设置为 `* * * * *` 实际的执行频率为每 5 分执行一次。\n\n## License\n\n[auto-green](https://github.com/AndersonHJB/AutoGreen) is released under the MIT License. See the bundled [LICENSE](./LICENSE) file for details.\n\n```\nname: ci\n\non:\n  push:\n    branches:\n      - master\n  schedule:\n    - cron: \"* */78 * * *\"\n\njobs:\n  autogreen:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Clone repository\n        uses: actions/checkout@v2\n\n      - name: Auto green\n        run: |\n          git config --local user.email \"cleland1432803776@icloud.com\"\n          git config --local user.name \"AndersonHJB\"\n          git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}\n          git pull --rebase\n          git commit --allow-empty -m \"a commit a day keeps your girlfriend away\"\n          git push\n```\n","readmeFilename":"README.md"}