diff --git a/deployment.py b/deployment.py index 84cfdc5..f1dbbe6 100644 --- a/deployment.py +++ b/deployment.py @@ -16,7 +16,10 @@ def run(): current_number = current_number + last_number last_number = temp - with open(os.environ['GITHUB_OUTPUT'], 'a+') as gh_output: + output_file_path = os.environ['GITHUB_OUTPUT'] + os.makedirs(os.path.dirname(output_file_path), exist_ok=True) # Create directory if it does not exist + + with open(output_file_path, 'a') as gh_output: # 'a' mode will create the file if it does not exist, otherwise it will append print(f'lastNumber={last_number}', file=gh_output)