Skip to content

Commit 647cfe7

Browse files
committed
don't fail on missing GITHUB_OUTPUT env var
to run locally
1 parent 475d64e commit 647cfe7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/bare_utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import json
44
import os
55
import uuid
6+
import warnings
67
from pathlib import Path
78
from typing import Any, Dict, Union
89

@@ -25,6 +26,10 @@ def set_gh_actions_output(name: str, output: Union[str, Any]):
2526
if not isinstance(output, str):
2627
output = json.dumps(output, sort_keys=True)
2728

29+
if "GITHUB_OUTPUT" not in os.environ:
30+
print(output)
31+
return
32+
2833
if "\n" in output:
2934
with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
3035
delimiter = uuid.uuid1()

0 commit comments

Comments
 (0)