Git Product home page Git Product logo

zhr-action-demo's Introduction

zhr-action-demo

GitHub Action Demo for https://github.com/upupming/zhr-action

浙江大学健康打卡自动打卡脚本 GitHub Action 例子,只需一步 Fork 即可使用,每天定时帮你自动打卡。

  • 🔔 2022.12.25 学校已经不再要求打卡,参考 zhr-action/#7,可以自行停用此脚本。

    【关于进一步优化校园疫情防控举措的通知】
    
    1.本校师生员工不再要求每日打卡,可通过人脸识别、校园卡、身份证等多种方式入校,蓝码逐步停止使用,学校加快开发电子校园卡作为师生移动端身份凭证,过渡期认可凭蓝码进入。师生驾驶已备案机动车(凭通行证)可直接进入校园,如驾驶非备案机动车经身份查验后进入校园。离退休同志参照上述方式进入校园。

使用方法

  1. 直接 Fork 本仓库

  2. 配置帐号(必须)

    Settings > Actions > General > Workflow permissions,改为 Read and write permissions,这样 Monthly Update Action 才能拥有更新仓库的权限,Monthly Update Action 每月运行一次,会向仓库添加一个新的 commit,是用来防止因为仓库长时间不活跃,而被 GitHub 自动禁用 Actions。

    Settings > Secrets > Actions > New repository secret, 添加 ZJU_USERNAME,内容为浙大通行证账号(学号),添加ZJU_PASSWORD,内容为浙大通行证密码。

    zju_account

    如果遇到登录异常问题,可添加 ZJU_COOKIE 这个 secret,请参考 https://github.com/upupming/zhr-action#%E7%99%BB%E5%BD%95%E5%BC%82%E5%B8%B8 进行配置,ZJU_PASSWORDZJU_COOKIE 二选一即可。

  3. 配置定时运行时间(可选)

    在 .github/workflows/health-report.yml 中更改时间:

    on:
    workflow_dispatch:
    schedule:
       # `0 23 * * *` 表示UTC 23:00,即北京时间7:00打卡(经测试,实际运行时间比设定时间晚几分钟到几十分钟)。
       # 可以参考 https://crontab.guru/ 进行配置
       - cron: '0 23 * * *'
  4. 配置钉钉消息通知(可选)

    • 手机版钉钉 > 右上角添加 > 面对面建群 > 创建之后得到只有你一个人的群聊
    • 电脑版钉钉 > 群设置 > 智能群助手 > 添加机器人 > 自定义,名字随便填,安全设置选择自定义关键字,填ZHR,然后下一步复制Webhook。
    • Settings > Secrets > Actions > New repository secret, 添加DINGTALK_TOKEN,内容为刚才复制的Webhook中 access_token= 后面的内容。
  5. 配置多人打卡(可选)

    在 .github/workflows/health-report.yml 中添加一组,自行添加对应的Secrets。

       - username: ZJU_USERNAME
         password: ZJU_PASSWORD
         dingtalk_token: DINGTALK_TOKEN
       - username: ZJU_USERNAME2
         password: ZJU_PASSWORD2
         dingtalk_token: DINGTALK_TOKEN2
  6. 启用 Action(必须)

    Actions > I understand my workflows, go ahead and enable them

    Actions > zhr-action Demo > Enable workflow > Run workflow。

    Actions > Monthly Update Action > Enable workflow > Run workflow。

  7. 停用 Action

    Actions > zhr-action Demo > Disable workflow。

    Actions > Monthly Update Action > Disable workflow。

zhr-action-demo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

zhr-action-demo's Issues

Actions中没有工作流

Fork之后,在Actions里看不到原始仓库中的工作流(开始会有两个工作流,前面有感叹号,之后就消失了)

邮件报错

443F527E-42D0-4C44-8C22-78748AE68401
69F34533-AD17-43E0-8939-630AE71EDD35

这两天打卡都成功了,但是github会发邮件报错

ZHR 官方最新公告讨论区

昨天不小心删除了一行代码,导致大家今天虽然脚本显示打卡成功了,但是实际上还未打卡,我刚刚已经修复了

为了避免类似的情况再次发生,当代码出现 Bug 已经修复时,我会在这个 issue 中发帖,大家可以 watch 仓库或者 subscribe 这个帖子获取最新的邮件通知。

image

打卡报错

手动打卡后,手动运行workflow报错,错误信息如下

Run zju-health-report/action@release
  with:
    username: ***
    password: ***
*** 登陆成功!

/home/runner/work/_actions/zju-health-report/action/release/api.ts:65
  if (errMsg) throw new Error(`打卡提交失败:${errMsg}
                    ^
Error: 打卡提交失败:Unexpected token p in JSON at position 0

将环境变量 NODE_ENV 设置为 development 可以获得 oldInfo 的详细信息,请参考官方文档: https://github.com/zju-health-report/action#%E5%91%BD%E4%BB%A4%E[8](https://github.com/zafirshi/zju-health-report-action-demo/runs/5800565896?check_suite_focus=true#step:2:8)%A1%8C-cli

    at submit (/home/runner/work/_actions/zju-health-report/action/release/api.ts:65:21)
    at processTicksAndRejections (node:internal/process/task_queues:[9](https://github.com/zafirshi/zju-health-report-action-demo/runs/5800565896?check_suite_focus=true#step:2:9)6:5)
    at Object.runZjuHealthReport (/home/runner/work/_actions/zju-health-report/action/release/api.ts:98:5)

账号异常登录

您好,我的钉钉消息通知提示我账号异常登录,让用手机号登录,请问这个是在哪里改呀?
2634f7d66bab67c1cbbb469130d0fbd

github action成功但是未打卡

昨天因为学校增加了一个所在校区的选项所以action失败,手动打卡了一次
今天显示action成功,但是实际上是未打卡

Error: ❌ 打卡提交失败,网页报错为:是否从下列地区返回浙江格式错误

Run upupming/zhr-action@release

zju-health-report (ZHR) - 浙江大学健康打卡自动化脚本

当前版本: 1.4.1@858f2f
Action: https://github.com/upupming/zhr-action
Demo: https://github.com/upupming/zhr-action-demo
如果有任何建议或意见,欢迎贡献代码!

已配置 eai-sess Cookie,跳过浙大通行证登录过程

✅ *** 登录成功!

Error: ❌ 打卡提交失败,网页报错为:是否从下列地区返回浙江格式错误

常见错误:
1. 今天已经打过卡了,可以忽略此报错。
2. 表单可能新增了内容,请检查之前的提交是否缺少了什么信息,如有必要请手动打一次卡。
3. 登录异常,请改为 Cookie 方式登录,参考 https://github.com/upupming/zhr-action#登录异常 进行配置。

将环境变量 NODE_ENV 设置为 development 可以获得 oldInfo 的详细信息,请参考官方文档: https://github.com/upupming/zhr-action#报告问题

Now, 打卡 is a thing of the past!

I'm pretty sure you heard that the daily self-screening is now discontinued, and that everyone has freedom now! No more endless COVID tests either! I guess you could add a note to README.md that the script is no longer needed to celebrate!

钉钉消息通知

消息通知这个确实还没有实现,主要是我个人用邮件多于钉钉。action出错了GitHub会自动发邮件通知(学院也会给发短信好像)。感觉已经够用了,是否增加通知还是看大家到底有没有这个需求吧,没人需要的话就不加了。

有需要的同学可以给本 issue 点赞 👍 ,需求量大的话考虑支持。当然任何时候非常欢迎 PR。

Originally posted by @zju-health-report-bot in #2 (comment)

定位问题

请问这个是根据什么定位的?是IP?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.