├── .gitignore ├── .github └── workflows │ ├── monthly-update.yml │ └── health-report.yml ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | -------------------------------------------------------------------------------- /.github/workflows/monthly-update.yml: -------------------------------------------------------------------------------- 1 | # 防止 GitHub 长时间不 commit 导致 Action 自动停用 2 | name: 'Monthly Update Action' 3 | 4 | on: 5 | workflow_dispatch: 6 | schedule: 7 | - cron: '0 0 1 * *' 8 | 9 | jobs: 10 | main: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v2 15 | - name: Update 16 | run: | 17 | echo "one month" >> monthly.log 18 | - name: Commit files 19 | run: | 20 | git config --local user.name github-actions[bot] 21 | git config --local user.email github-actions[bot]@users.noreply.github.com 22 | git status 23 | git add monthly.log 24 | git commit -m "Monthly update" 25 | git log 26 | git push 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022-present upupming 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. 22 | -------------------------------------------------------------------------------- /.github/workflows/health-report.yml: -------------------------------------------------------------------------------- 1 | name: 'zhr-action Demo' 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | # `0 23 * * *` 表示UTC 23:00,即北京时间7:00打卡(经测试,实际运行时间比设定时间晚几分钟到几十分钟)。 7 | # 可以参考 https://crontab.guru/ 进行配置 8 | - cron: '0 23 * * *' 9 | 10 | jobs: 11 | main: 12 | runs-on: ubuntu-latest 13 | strategy: 14 | fail-fast: false 15 | matrix: 16 | include: 17 | - username: ZJU_USERNAME 18 | password: ZJU_PASSWORD 19 | # 如果出现登录异常,可以配置 ZJU_COOKIE secret,请参考 https://github.com/upupming/zhr-action#%E7%99%BB%E5%BD%95%E5%BC%82%E5%B8%B8 获取 ZJU_COOKIE 的值 20 | cookie_eai_sess: ZJU_COOKIE 21 | dingtalk_token: DINGTALK_TOKEN 22 | steps: 23 | - name: 打卡 24 | uses: upupming/zhr-action@release 25 | with: 26 | username: ${{ secrets[matrix.username] }} 27 | password: ${{ secrets[matrix.password] }} 28 | cookie_eai_sess: ${{ secrets[matrix.cookie_eai_sess] }} 29 | dingtalk_token: ${{ secrets[matrix.dingtalk_token] }} 30 | env: 31 | ACTION_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # zhr-action-demo 2 | 3 |
4 |
5 |