#!/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
import json,os

if __name__=='__main__':
    current_run_path = os.path.dirname(os.path.realpath(__file__))
    with open(os.path.join(current_run_path,"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)