Skip to content

Commit 2dd7224

Browse files
committed
use new github actions output method
1 parent 71efaa3 commit 2dd7224

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

tools/update_specific_types.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
newReleaseRequired = False
1111

1212

13+
def set_output(key, value):
14+
# https://github.com/orgs/community/discussions/28146#discussioncomment-4110404
15+
with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
16+
print(f"{key}={value}", file=fh)
17+
18+
1319
def hash(pth):
1420
md5 = hashlib.md5()
1521
with open(pth, "rb") as fl:
@@ -130,9 +136,7 @@ def hash(pth):
130136
if not hash(basePath + f) in hashes:
131137
newReleaseRequired = True
132138

133-
os.system(
134-
f'echo "release={("true" if newReleaseRequired else "false")}" >> $GITHUB_OUTPUT'
135-
)
139+
set_output("release", "true" if newReleaseRequired else "false")
136140

137141
if newReleaseRequired:
138142
print("There will be a new release.")
@@ -147,7 +151,8 @@ def hash(pth):
147151
newTag = ".".join(newTagParts)
148152

149153
print("New release tag:", newTag)
150-
os.system(f'echo "tag={newTag}" >> $GITHUB_OUTPUT')
151-
os.system(f'echo "mcver={latestVersion}" >> $GITHUB_OUTPUT')
154+
155+
set_output("tag", newTag)
156+
set_output("mcver", latestVersion)
152157

153158
print("Done.")

0 commit comments

Comments
 (0)