Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tianzhengs committed Nov 16, 2021
1 parent 57bea54 commit 92819fa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
12 changes: 12 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@
username = os.environ["USERNAME"]
password = os.environ["PASSWORD"]


if not (username and password):
raise Exception("请设置Secret: USERNAME和PASSWORD")

# or check string type
try:
org_id_input = os.environ["ORGID"]
if org_id_input:
org_id=int(org_id_input)
except:
...

def encrypt(t):
public_key = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD5uIDebA2qU746e/NVPiQSBA0Q3J8/G23zfrwMz4qoip1vuKaVZykuMtsAkCJFZhEcmuaOVl8nAor7cz/KZe8ZCNInbXp2kUQNjJiOPwEhkGiVvxvU5V5vCK4mzGZhhawF5cI/pw2GJDSKbXK05YHXVtOAmg17zB1iJf+ie28TbwIDAQAB\n-----END PUBLIC KEY-----"
rsa_key = RSA.importKey(public_key)
Expand Down
10 changes: 6 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

建议配置运行频率一周2次(默认为3天一次),没有成功会出错,默认配置下Github会向邮箱推送,所以没有推送功能

(组织不是海淀区团委可能需要修改org_id)



# How to use
Expand All @@ -14,9 +14,11 @@

​ (账号密码为登录青春北京的信息,可以在[这里](https://m.bjyouth.net/site/login)测试登录信息)

​ USERNAME: 账号

​ PASSWORD: 密码
| Name | Description |
| -------- | -------- |
| USERNAME | 账号(必须) |
| PASSWORD | 密码(必须) |
| ORGID | 组织ID(可选,默认为172442,北京海淀区团委) |

[如何添加SECRET](https://docs.github.com/cn/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository)

Expand Down

0 comments on commit 92819fa

Please sign in to comment.