Skip to content

Commit

Permalink
Update publish.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Blinue authored Oct 11, 2023
1 parent f2f156a commit 7bc7132
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
from xml.etree import ElementTree

try:
if os.environ["GITHUB_ACTIONS"] == True:
if "GITHUB_ACTIONS" in os:
# 不知为何在 Github Actions 中运行时默认编码为 ANSI,而且每次 print 都刷新流才能正常显示
for stream in [sys.stdout, sys.stderr]:
stream.reconfigure(encoding='utf-8')
print("GITHUB_ACTIONS", flush=True)
else:
print("test", flush=True)
except:
pass

Expand Down

0 comments on commit 7bc7132

Please sign in to comment.