Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

Minimal GitHub action for BUAA NCOV daily report.

License

Notifications You must be signed in to change notification settings

xxgj/buaa-ncov-report-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

buaa-ncov-report-action

GitHub stars GitHub forks GitHub commit activity GitHub issues GitHub pulls Contributors GitHub license

Minimal GitHub action for BUAA NCOV daily report.

Quick Start

Only 2 steps needed:

  1. Creating a repository by Use this template: See Creating a repository from a template for details.

  2. Creating encrypted secrets: See Creating encrypted secrets for a repository for details.

    You should create two secrets:

    • USERNAME: your BUAA SSO username
    • PASSWORD: your BUAA SSO password

How It Works

buaa-ncov-report-action uses python-requests to report.

  1. Login

    # login
    login = s.post(url='https://app.buaa.edu.cn/uc/wap/login/check',
                   data={
                       'username': os.environ['USERNAME'],
                       'password': os.environ['PASSWORD']
                   },
                   headers=header)
  2. Getting yesterday's info

    # get info
    info = s.get(url='https://app.buaa.edu.cn/buaaxsncov/wap/default/get-info',
                 headers=header)
  3. Report

    # report
    report = s.post(url='https://app.buaa.edu.cn/buaaxsncov/wap/default/save',
                    data=json.loads(info.text)['d']['oldInfo'],
                    headers=header)

buaa-ncov-report-action uses GitHub Action to trigger report.py.

report.yml schedules a workflow to run at specific UTC times(9:00 UTC) using POSIX cron syntax:

on:
  workflow_dispatch:
  schedule:  
  - cron: '0 9 * * *'

Since GitHub will send an email notification of workflow error messages to you when workflow fails, buaa-ncov-report-action does not implement another way for notification.

You can run workflow by yourself and view log at here.

Known BUGs

Feel free to open an issue if you have any questions.

  1. There is slight difference between the real report data and yesterday's data. Nevertheless, it doesn't matter because I have used this for over 6 months and everything is fine.
  2. Scheduled workflows will be disabled automatically after 60 days of repository inactivity. See here for details. You will receive an email before the workflow is disabled and you can prevent it from being disabled on workflow page.

License

buaa-ncov-report-action released under the MIT license.

About

Minimal GitHub action for BUAA NCOV daily report.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages