Skip to content

Commit 3d7353b

Browse files
committed
support SSH when finding repo name from git remote URL
1 parent 1d9dbe6 commit 3d7353b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/tag-release.nu

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,15 @@ export def find-first-commit [] {
122122
# Defaults to parsing the working directory's `origin` remote url.
123123
export def find-repo-name [] {
124124
$env | get --optional "GITHUB_REPO" | default {
125-
(^git remote get-url origin)
126-
| str trim
125+
let origin = (^git remote get-url origin) | str trim
126+
(
127+
if (not ($origin | str starts-with "https://")) {
128+
let patched_ssh = $origin | str replace --regex '([^:]):' '$1:/'
129+
$"ssh://($patched_ssh)"
130+
} else {
131+
$origin
132+
}
133+
)
127134
| url parse
128135
| get path
129136
| str trim --left --char "/"

0 commit comments

Comments
 (0)