Skip to content

Commit cc2b8d1

Browse files
committed
Remove warning for GitHub output
1 parent 49143b0 commit cc2b8d1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

check_version.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
import requests
24
from spam_detector_ai.__info__ import __version__, __package_name__, __test_version__
35

@@ -17,8 +19,10 @@ def check_package_version(package_name, current_version):
1719
print(f"Version {current_version} already exists on PyPI!")
1820
version_exists = True
1921

20-
# Output for GitHub Actions
21-
print(f"::set-output name=version_exists::{version_exists}")
22+
# Output for GitHub Actions using environment files
23+
if "GITHUB_OUTPUT" in os.environ:
24+
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
25+
f.write(f"version_exists={version_exists}\n")
2226

2327

2428
if __name__ == "__main__":

0 commit comments

Comments
 (0)