Skip to content

Commit

Permalink
Fix the clickable stdlib URLs in the PR descriptions (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
DilumAluthge authored Nov 7, 2021
1 parent 2da0931 commit 97143f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "BumpStdlibs"
uuid = "10e0400f-8273-43d0-bd6e-07483373ba4f"
authors = ["Dilum Aluthge", "contributors"]
version = "4.4.1"
version = "5.0.0"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
15 changes: 5 additions & 10 deletions src/util.jl
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
function _try_extract_clickable_url_from_git_url(git_url::AbstractString)
git_url_stripped = strip(git_url)
regex_1 = r"^git:\/\/github.com\/([\w\-]*?)\/([\w\-\.]*?).git$"
m_1 = match(regex_1, git_url_stripped)
if m_1 !== nothing
owner = m_1[1]
repo = m_1[2]
return "https://github.com/$(owner)/$(repo)"
git_url_stripped = convert(String, strip(git_url))::String
if startswith(lowercase(git_url_stripped), "https://")
return git_url_stripped
end
return nothing
end

function _git_url_to_formatted_markdown(git_url::AbstractString)
git_url_stripped = strip(git_url)
git_url_stripped = convert(String, strip(git_url))::String
clickable_url_maybe = _try_extract_clickable_url_from_git_url(git_url_stripped)
if clickable_url_maybe === nothing
@warn "Could not convert Git URL into a clickable link" git_url
return "`$(git_url_stripped)`"
end
clickable_link_markdown = "[$(clickable_url_maybe)]($(clickable_url_maybe))"
return clickable_link_markdown
return clickable_url_maybe
end

2 comments on commit 97143f0

@DilumAluthge
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/48323

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v5.0.0 -m "<description of version>" 97143f0711a1df27035fad46eecd2a2a2ed141ec
git push origin v5.0.0

Please sign in to comment.