@codefresh-io/cf-git-providers 0.5.0-CR-14399 → 0.5.0-CR-14399-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -108,17 +108,17 @@ const _toUser = (rawUser, rawEmails) => {
|
|
|
108
108
|
};
|
|
109
109
|
const _toUserFromCommit = (commit) => {
|
|
110
110
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
111
|
-
const
|
|
111
|
+
const authorRegex = /(.*?)\s<(.*?)>/g;
|
|
112
112
|
const rawAuthor = (_a = commit.author) === null || _a === void 0 ? void 0 : _a.raw;
|
|
113
|
-
const
|
|
114
|
-
if (!
|
|
113
|
+
const authorInfo = authorRegex.exec(rawAuthor);
|
|
114
|
+
if (!authorInfo) {
|
|
115
115
|
throw new CFError(`failed to get user from commit ${commit}`);
|
|
116
116
|
}
|
|
117
117
|
return {
|
|
118
|
-
login:
|
|
119
|
-
avatar_url: ((_e = (_d = (_c = (_b = commit === null || commit === void 0 ? void 0 : commit.
|
|
120
|
-
email:
|
|
121
|
-
web_url: ((_j = (_h = (_g = (_f = commit === null || commit === void 0 ? void 0 : commit.
|
|
118
|
+
login: authorInfo[1],
|
|
119
|
+
avatar_url: ((_e = (_d = (_c = (_b = commit === null || commit === void 0 ? void 0 : commit.author) === null || _b === void 0 ? void 0 : _b.user) === null || _c === void 0 ? void 0 : _c.links) === null || _d === void 0 ? void 0 : _d.avatar) === null || _e === void 0 ? void 0 : _e.href) || '',
|
|
120
|
+
email: authorInfo[2] || '',
|
|
121
|
+
web_url: ((_j = (_h = (_g = (_f = commit === null || commit === void 0 ? void 0 : commit.author) === null || _f === void 0 ? void 0 : _f.user) === null || _g === void 0 ? void 0 : _g.links) === null || _h === void 0 ? void 0 : _h.html) === null || _j === void 0 ? void 0 : _j.href) || '',
|
|
122
122
|
};
|
|
123
123
|
};
|
|
124
124
|
class Bitbucket {
|