main.py 938 B

12345678910111213141516171819202122232425262728
  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. from set_github_secret.utils.frozen_dir import get_app_path
  11. import json,os,sys
  12. if __name__=='__main__':
  13. current_run_path = get_app_path()
  14. if os.path.exists("account.json"):
  15. with open("account.json", "r") as file:
  16. data = json.load(file)
  17. owner=data["owner"]
  18. token=data["token"]
  19. repo = data["repo"]
  20. github_api = GithubApi(owner=owner, token=token, repo=repo)
  21. for i in data["secret"]:
  22. key=i["key"]
  23. value=i["value"]
  24. github_api.set_update_github_secret(key, value)
  25. else:
  26. print(f"account.json not found, current path: {current_run_path}")