UNPKG

deletable-branches

Version:

List remote tracking branches in a Git repo that were in PRs that were squashed and merged into master.

7 lines (6 loc) 206 B
exports.getRepoName = (remoteUrl, orgName) => { const re = new RegExp(`(?<=git@github.com:${orgName}/).*(?=[.]git$)`); const m = remoteUrl.match(re); if (!m || !m.length) return ""; return m[0]; };