Skip to content

Commit

Permalink
fix: eof needs more newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
DerTiedemann committed Oct 9, 2024
1 parent 0a974ba commit bc8eae6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions actions/parse-secrets-definitions/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,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}<<EOF{output_value}EOF\n') # ATTENTION: this might lead to problems if the output value contains the delimiter, which will not happen in this program but dont just copy this and expect it to work
f.write(f'{output_name}<<!!!\n{output_value}!!!\n') # ATTENTION: this might lead to problems if the output value contains the delimiter, which will not happen in this program but dont just copy this and expect it to work
f.close()


Expand All @@ -19,8 +19,8 @@ def set_github_action_output(output_name, output_value, delim=''):
# if the secret would end in an underscore, remove it
# format: SECRET_NAME:PROJECT_NAME/SECRET_NAME/VERSION
def parse_secret(secret, project_name):
if "EOF" in secret:
raise ValueError("Invalid secret definition: EOF is a reserved keyword FIXME")
if "!!!" in secret:
raise ValueError("Invalid secret definition: !!! is a reserved keyword")
components = secret.split("/")

if len(components) > 2:
Expand Down

0 comments on commit bc8eae6

Please sign in to comment.