Skip to content

Commit daa9b2c

Browse files
GitHub: Support non-MD5 checksum files
Difference with MD5-sum files in this script is mere semantics, because it just prints contents of file. However I assume that it is not very good to pass SHA-sum file via `--md5sum-file` option. Signed-off-by: Anton Kolesov <[email protected]>
1 parent c59ba60 commit daa9b2c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

github/create-release.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
parser.add_argument("--name", required=True)
3232
parser.add_argument("--description", default="")
3333
parser.add_argument("--md5sum-file", help="File with md5sums for uploaded assets")
34+
parser.add_argument("--checksum-file", help="File with hash sums for uploaded assets")
3435
parser.add_argument("--draft", action="store_true", default=False)
3536
parser.add_argument("--prerelease", action="store_true", default=False)
3637
parser.add_argument("--oauth-token", required=True)
@@ -79,6 +80,11 @@
7980
text = f.read()
8081
args.description = args.description + "\n```\n" + text + "\n```"
8182

83+
if args.checksum_file is not None:
84+
with open(args.checksum_file, "r") as f:
85+
text = f.read()
86+
args.description = args.description + "\n```\n" + text + "\n```"
87+
8288
gh_conn = ghapi.GitHubApi(args.owner, args.project, args.oauth_token)
8389
release_id = gh_conn.create_release(args.tag, args.name, args.description,
8490
args.draft, args.prerelease)

0 commit comments

Comments
 (0)