Skip to content

Commit e07a85a

Browse files
committed
fix: allow many variables without issues
1 parent fcfb02d commit e07a85a

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

entrypoint.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,16 @@
44
import re
55
import subprocess
66

7-
flags = []
7+
params = [os.environ['INPUT_TEMPLATE']]
88

9-
variables = re.compile('\n+', re.MULTILINE).sub(
10-
',',
11-
os.environ['INPUT_VARIABLES']
12-
)
9+
for variable in os.environ.get('INPUT_VARIABLES', '').split('\n'):
10+
clean_variable = variable.strip()
11+
if clean_variable != '':
12+
params.extend(['-D', clean_variable])
1313

1414
if os.environ.get('INPUT_STRICT') == 'true':
15-
flags.append('--strict')
15+
params.append('--strict')
1616

17-
flags.extend([
18-
os.environ['INPUT_TEMPLATE'],
19-
'-D', variables,
20-
'-o', os.environ['INPUT_OUTPUT_FILE']
21-
])
17+
params.extend(['-o', os.environ['INPUT_OUTPUT_FILE']])
2218

23-
subprocess.run(['jinja2'] + flags)
19+
subprocess.run(['jinja2'] + params)

0 commit comments

Comments
 (0)