main.py 855 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env python
  2. # -*- encoding: utf-8 -*-
  3. '''
  4. @Contact : liuyuqi.gov@msn.cn
  5. @Time : 2023/11/13 15:27:04
  6. @License : Copyright © 2017-2022 liuyuqi. All Rights Reserved.
  7. @Desc : enter point
  8. '''
  9. from set_github_secret import GithubApi
  10. import json,os,sys
  11. if __name__=='__main__':
  12. # current_run_path = os.path.dirname(os.path.realpath(__file__)) 错误: windows exe 定位到 temp目录
  13. current_run_path = sys.path[0]
  14. with open(os.path.join(current_run_path,"account.json"), "r") as file:
  15. data = json.load(file)
  16. owner=data["owner"]
  17. token=data["token"]
  18. repo = data["repo"]
  19. github_api = GithubApi(owner=owner, token=token, repo=repo)
  20. for i in data["secret"]:
  21. key=i["key"]
  22. value=i["value"]
  23. github_api.set_update_github_secret(key, value)