2 Object.defineProperty(exports, "__esModule", { value: true });
3 const tslib_1 = require("tslib");
4 const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
5 const releaseFilter = /^v\d+\.\d+\.\d+$/;
6 async function checkLatestTag(repo, prefixFilter) {
7 const resp = await node_fetch_1.default(`https://api.github.com/repos/${repo}/tags`);
8 const data = await resp.json();
9 let tags = data.map(t => t.name);
12 .filter(t => t.match(prefixFilter))
13 .map(t => t.replace(prefixFilter, ''));
16 .filter(t => t.match(releaseFilter));
17 return tags.length > 0
18 ? tags[0].replace(/^v/, '')
21 exports.default = checkLatestTag;
22 //# sourceMappingURL=checktag.js.map