Skip to content

Commit 5881ff3

Browse files
committed
remove key search from get_github_output()
multiline output format change
1 parent 5cac7f5 commit 5881ff3

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

tests/integration.py

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,10 @@
1818
logging.basicConfig(level=logging.INFO)
1919

2020

21-
def get_github_output(output_name:str) -> str:
21+
def get_github_output() -> str:
2222
'''
2323
Reads the GITHUB_OUTPUT environment file and returns the value of the specified output.
2424
'''
25-
result = None
26-
27-
found_keys = []
2825

2926
with open(os.environ['GITHUB_OUTPUT'], 'r') as f:
3027
txt = f.read()
@@ -35,21 +32,16 @@ def get_github_output(output_name:str) -> str:
3532

3633
logging.warning(f'# lines of GITHUB_OUTPUT: {len(txt_lines)}')
3734

38-
for line in txt.splitlines():
39-
key, value = line.strip().split('=')
40-
found_keys.append(key)
41-
if key == output_name:
42-
result = value
43-
44-
if result is None:
45-
logging.warning(
46-
f'Output {output_name} not found in GITHUB_OUTPUT file\n'
47-
f'Keys found: {found_keys}'
48-
)
35+
if len(txt_lines) < 100:
36+
logging.info(txt)
4937

50-
return result # Or raise an exception if the output is not found
38+
return len(txt)
5139

5240

5341
def test_feedback() -> None:
54-
feedback_str = get_github_output('feedback')
42+
feedback_str = get_github_output()
5543
assert feedback_str, 'No feedback found'
44+
45+
46+
if "__main__" == __name__:
47+
pytest.main([__file__])

0 commit comments

Comments
 (0)