We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f435ec0 commit d7dc4ddCopy full SHA for d7dc4dd
index.js
@@ -139,9 +139,11 @@ export function getCommitsSince(sinceCommit = null) {
139
/** Gets the current repository. */
140
export function getRepo() {
141
const url = exec("git", ["config", "--get", "remote.origin.url"]);
142
- const match = /(\w+)\/(\w+)(?:\.git)?$/.exec(url);
+ const match = /\/(\w(?:[-_.]?\w)*)\/(\w(?:[-_.]?\w)*)$/.exec(url);
143
if (!match) throw Error("invalid repository url: " + url);
144
- return match[1] + "/" + match[2];
+ const user = match[1];
145
+ const repo = match[2].replace(/\.git$/, "");
146
+ return `${user}/${repo}`;
147
}
148
149
/** Gets the GitHub token to use. */
0 commit comments