# Github常绿养号 **Published by:** [Mofei](https://paragraph.com/@mofei/) **Published on:** 2024-05-26 **URL:** https://paragraph.com/@mofei/github ## Content 先准备:登录好并打开github首页第一步:点击 New repository第二步:输入项目名称(随意),勾选Add a README file,最后点击Create repository第三步:点击Actions第四步:第五步:在如下框中输入自动执行信息执行信息如下,设置好点击右上角的 Commit changes... 即可完成!如需修改执行频率可修改0 */6 * * *为其它,本例为6小时提交一次代码。 name: main on: push: branches: - main schedule: - cron: "0 */6 * * *" permissions: contents: write jobs: autogreen: runs-on: ubuntu-latest steps: - name: Clone repository uses: actions/checkout@v2 - name: stick run: | date > date.txt git config --local user.name "自己的github用户名(重要)" git config --local user.email "自己的github邮箱(重要)" git add date.txt git commit --allow-empty -m "updated txt" git push ## Publication Information - [Mofei](https://paragraph.com/@mofei/): Publication homepage - [All Posts](https://paragraph.com/@mofei/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@mofei): Subscribe to updates