diff --git a/src/gitea_connector.py b/src/gitea_connector.py index f7ee8b2..e8c7da1 100644 --- a/src/gitea_connector.py +++ b/src/gitea_connector.py @@ -11,6 +11,7 @@ HEADERS = { 'accept': 'application/json', } BRANCH_NAME = 'auto-' + datetime.now().strftime("%Y%m%d-%H%M%S") +FILE_NAME = 'dg_parser_' + datetime.now().strftime("%Y%m%d-%H%M%S") ''' @@ -31,9 +32,9 @@ def clone_repository(): def commit_and_push_changes(text_to_append, commit_message): repo = git.Repo(REPO_PATH) repo.git.checkout("-b", BRANCH_NAME) - with open(REPO_PATH + "/pis/gw.yaml", 'a') as file: + with open(REPO_PATH + f"/pis/{FILE_NAME}.yaml", 'w') as file: file.write(text_to_append) - repo.index.add(["pis/gw.yaml"]) + repo.index.add([f"pis/{FILE_NAME}.yaml"]) repo.index.commit(commit_message) origin = repo.remote(name='origin') origin_url_credentials = REPO_URL.replace('https://', f'https://{USER}:{TOKEN}@')