55from itertools import zip_longest
66
77
8+ def find_tool_url ():
9+ lib_version = os .getenv ("INPUT_VERSION" , "" ).strip ()
10+ if lib_version :
11+ return "https://github.com/JakeWharton/diffuse/releases/download/{0}/diffuse-{0}-binary.jar" \
12+ .format (lib_version )
13+ else :
14+ return "https://github.com/usefulness/diffuse/releases/download/{0}/diffuse-{0}-binary.jar" \
15+ .format (os .getenv ("INPUT_FORK_VERSION" ))
16+
17+
818def is_debug ():
919 return os .getenv ("INPUT_DEBUG" , False )
1020
1121
12- def github_output (message : str ):
22+ def github_output (message ):
1323 return message .replace ("%" , "%25" ) \
1424 .replace ("\n " , "%0A" ) \
1525 .replace ("\r " , "%0D" ) \
1626 .replace ('\x00 ' , '' )
1727
1828
19- def section (_title : str , _content : str ):
29+ def section (_title , _content ):
2030 return f"""
2131<details>
2232 <summary>{ _title } </summary>
@@ -29,7 +39,7 @@ def section(_title: str, _content: str):
2939"""
3040
3141
32- def header (_content : str ):
42+ def header (_content ):
3343 return f"""
3444\\ `\\ `\\ `
3545{ _content }
@@ -56,8 +66,7 @@ def sizeof_fmt(num, suffix='B', sign=False):
5666 return "%.1f%s%s" % (num , 'Yi' , suffix )
5767
5868
59- url = "https://github.com/JakeWharton/diffuse/releases/download/{0}/diffuse-{0}-binary.jar" \
60- .format (os .getenv ("INPUT_VERSION" ))
69+ url = find_tool_url ()
6170downloadArgs = ""
6271if not is_debug ():
6372 downloadArgs += "-q"
@@ -156,4 +165,5 @@ def sizeof_fmt(num, suffix='B', sign=False):
156165os .system (f"echo \" ::set-output name=diff-gh-comment::{ github_output (github_comment )} \" " )
157166os .system (f"echo \" ::set-output name=diff-gh-comment-all-collapsed::{ github_output (github_comment_all_collapsed )} \" " )
158167os .system (f"echo \" ::set-output name=diff-gh-comment-no-dex::{ github_output (github_comment_no_dex )} \" " )
159- os .system (f"echo \" ::set-output name=diff-gh-comment-no-dex-all-collapsed::{ github_output (github_comment_no_dex_all_collapsed )} \" " )
168+ os .system (
169+ f"echo \" ::set-output name=diff-gh-comment-no-dex-all-collapsed::{ github_output (github_comment_no_dex_all_collapsed )} \" " )
0 commit comments