main.py 772 B

1234567891011121314151617181920212223
  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
  11. if __name__=='__main__':
  12. current_run_path = os.path.dirname(os.path.realpath(__file__))
  13. with open(os.path.join(current_run_path,"account.example.json"), "r") as file:
  14. data = json.load(file)
  15. owner=data["owner"]
  16. token=data["token"]
  17. repo = data["repo"]
  18. github_api = GithubApi(owner=owner, token=token, repo=repo)
  19. for i in data["secret"]:
  20. key=i["key"]
  21. value=i["value"]
  22. github_api.set_update_github_secret(key, value)