Skip to content

Commit b0f5cc0

Browse files
committed
Fix release script to fetch the correct commit hash.
Include the branch name whilst we're at it.
1 parent e7bacee commit b0f5cc0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Tools/Scripts/release.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ def remove_suffix(string, suffix):
6363
line = 'let version = "' + version + '"'
6464
print(line)
6565

66-
sdk_commit_hash = subprocess.getoutput("cat " + sdk_path + "/.git/refs/heads/main")
66+
sdk_commit_hash = subprocess.check_output("git rev-parse HEAD", shell=True, cwd=sdk_path).decode("utf-8").rstrip()
67+
sdk_branch = subprocess.check_output("git rev-parse --abbrev-ref HEAD", shell=True, cwd=sdk_path).decode("utf-8").rstrip()
6768
print("SDK commit: " + sdk_commit_hash)
68-
commit_message = "Bump to " + version + " (matrix-rust-sdk " + sdk_commit_hash + ")"
69+
commit_message = "Bump to " + version + " (matrix-rust-sdk/" + sdk_branch + " " + sdk_commit_hash + ")"
6970
print("Pushing changes as: " + commit_message)
7071
os.system("git add " + root + "/Package.swift")
7172
os.system("git add " + root + "/Sources")

0 commit comments

Comments
 (0)