From 51bbf98b50834061699bb95c49d01b3398f9a687 Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Wed, 9 Oct 2024 05:53:34 +0200 Subject: [PATCH] fix: add tests + delimiter global + removal of pycache from gitignore --- .gitignore | 1 + actions/parse-secrets-definitions/main.py | 9 +++++---- actions/parse-secrets-definitions/tests.py | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 actions/parse-secrets-definitions/tests.py diff --git a/.gitignore b/.gitignore index d01517ef2..b63051c05 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ tmp* auto-doc* ./test* +**/__pycache__/ diff --git a/actions/parse-secrets-definitions/main.py b/actions/parse-secrets-definitions/main.py index 5239db355..ef7e97656 100644 --- a/actions/parse-secrets-definitions/main.py +++ b/actions/parse-secrets-definitions/main.py @@ -1,6 +1,8 @@ import os import re +DELIMITER = "!!!" + # CAVEAT: will only work for one project at a time # might be problematic if we want to inject secrets from multiple projects @@ -10,7 +12,7 @@ # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter def set_github_action_output(output_name, output_value, delim=''): f = open(os.path.abspath(os.environ["GITHUB_OUTPUT"]), "a") - f.write(f'{output_name}<