1234567891011121314151617181920212223242526272829 |
- #!/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_circleci_secret import circleciApi
- from set_circleci_secret.utils.frozen_dir import get_app_path
- import yaml,os,sys
- if __name__=='__main__':
-
- current_run_path = get_app_path()
- conf_path = os.path.join(current_run_path, "account.yml")
- if os.path.exists(conf_path):
- with open(conf_path, "r") as file:
- data = yaml.load(file, Loader=yaml.FullLoader)
- owner=data["owner"]
- token=data["token"]
- repo = data["repo"]
- circleci_api = circleciApi(owner=owner, token=token, repo=repo)
- for i in data["secret"]:
- key=i["key"]
- value=i["value"]
- circleci_api.set_update_circleci_secret(key, value)
- else:
- print(f"account.yml not found, current path: {conf_path}")
|