12345678910111213141516171819202122232425262728 |
- #!/usr/bin/env python
- # -*- encoding: utf-8 -*-
- '''
- @Contact : liuyuqi.gov@msn.cn
- @Time : 2023/11/13 15:27:04
- @License : Copyright © 2017-2022 liuyuqi. All Rights Reserved.
- @Desc : enter point
- '''
- from set_github_secret import GithubApi
- from set_github_secret.utils.frozen_dir import get_app_path
- import json,os,sys
- if __name__=='__main__':
-
- current_run_path = get_app_path()
- if os.path.exists("account.json"):
- with open("account.json", "r") as file:
- data = json.load(file)
- owner=data["owner"]
- token=data["token"]
- repo = data["repo"]
- github_api = GithubApi(owner=owner, token=token, repo=repo)
- for i in data["secret"]:
- key=i["key"]
- value=i["value"]
- github_api.set_update_github_secret(key, value)
- else:
- print(f"account.json not found, current path: {current_run_path}")
|