Tools for GitHub releases
assert get_repo_name("https://github.com/PabloRMira/easyrelease") == "PabloRMira/easyrelease"
assert get_repo_name("https://github.com/PabloRMira/easyrelease/tree/main") == "PabloRMira/easyrelease"
assert get_repo_name("https://github.enterprise.com/PabloRMira/easyrelease/tree/main") == "PabloRMira/easyrelease"
assert get_base_repo_url("https://github.com/PabloRMira/easyrelease") == "https://github.com/PabloRMira/easyrelease"
assert (
get_base_repo_url(
"https://github.com/PabloRMira/easyrelease/tree/main"
) == "https://github.com/PabloRMira/easyrelease"
)
if not check_git_dir():
os.chdir("..") # we need this if we test locally in the notebook itself
msg = "* [FIX] Some bug (#100)"
msg_link = add_pull_request_link(msg)
expected_msg_link = "* [FIX] Some bug ([#100](https://github.com/PabloRMira/easyrelease/pull/100))"
assert msg_link == expected_msg_link
if not check_git_dir:
os.chdir("..") # we need this if we test locally in the notebook itself
commit_msgs = [
"[FIX] Some bug",
"[FEA] My new feature"
]
gh_config = {"gh_categories":
[{"title": "Bugfixes:", "keyword": "[FIX]"},
{"title": "New features:", "keyword": "[FEA]"}]}
report = release_report(gh_config, commit_msgs, "Nice title!")
expected_report = "Nice title!\n\nBugfixes:\n* [FIX] Some bug\n\nNew features:\n* [FEA] New features"