Skip to content

Commit

Permalink
Merge pull request #56 from lukasz-mitka/patch-1
Browse files Browse the repository at this point in the history
Fix output
  • Loading branch information
sondrelg authored Feb 14, 2023
2 parents 192ba6d + 9a06221 commit 482ce28
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,8 @@ async def main(
]:
comma_separated_list = ','.join(l)

with open(os.environ['GITHUB_ENV'], 'a') as f:
f.write(f'{name}={comma_separated_list}')
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
f.write(f'{name}={comma_separated_list}\n')


if __name__ == '__main__':
Expand Down
12 changes: 6 additions & 6 deletions main_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ def http_client(ok_response):


@pytest.fixture(autouse=True)
def github_env():
def github_output():
"""
Create a GITHUB_ENV env value to mock the Github actions equivalent.
Create a GITHUB_OUTPUT env value to mock the Github actions equivalent.
"""
with tempfile.NamedTemporaryFile() as temp:
os.environ['GITHUB_ENV'] = temp.name
os.environ['GITHUB_OUTPUT'] = temp.name
yield


Expand Down Expand Up @@ -589,12 +589,12 @@ async def test_outputs_are_set(mocker):
'token': 'test',
}
)
with open(os.environ['GITHUB_ENV']) as f:
env_vars = f.readlines()[0]
with open(os.environ['GITHUB_OUTPUT']) as f:
out_vars = f.read()

for i in [
'needs-github-assistance=',
'deleted=',
'failed=',
]:
assert i in env_vars
assert i in out_vars

0 comments on commit 482ce28

Please sign in to comment.