diff --git a/main.py b/main.py index 0f30997..d2d4359 100644 --- a/main.py +++ b/main.py @@ -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__': diff --git a/main_tests.py b/main_tests.py index 67bb79a..da364df 100644 --- a/main_tests.py +++ b/main_tests.py @@ -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 @@ -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