Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 60bff92

Browse files
authored
Merge pull request segmentio#5440 from segmentio/develop
Release 23.39.2
2 parents 69e1b7c + a293225 commit 60bff92

29 files changed

+1521
-572
lines changed

scripts/changelog.js

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
const axios = require('axios');
2+
const path = require('path');
3+
const fs = require('fs');
4+
const fm = require('front-matter');
5+
const yaml = require('js-yaml');
6+
7+
API_URL = "https://api.github.com/repos/segmentio/"
8+
9+
const getLog = async (url = "") => {
10+
try {
11+
const res = await axios.get(url, {
12+
headers: {
13+
'Content-Type': 'application/json',
14+
}
15+
});
16+
return res.data
17+
} catch (error) {
18+
console.log(error)
19+
}
20+
}
21+
let libraries = ["analytics-android","analytics-ios", "analytics-react-native", "analytics-node", "analytics-python", "analytics-php", "analytics-go", "analytics-java", "analytics.NET"]
22+
23+
const replace_token = /.+\r\n(-{2,}\r\n)|.+\r\n(={2,}\r\n)/mg;
24+
const subst = ``
25+
26+
const updateLog = async(library) => {
27+
28+
let releasesUpdated = []
29+
let url = API_URL+library+'/releases'
30+
const releases = await getLog(url)
31+
releases.forEach(release => {
32+
let note = release.body
33+
cleaned_note = note.replace(replace_token,subst)
34+
let updatedRelease = {
35+
version: release.name,
36+
url: release.html_url,
37+
date: release.published_at,
38+
notes: cleaned_note
39+
}
40+
releasesUpdated.push(updatedRelease)
41+
})
42+
43+
const options = { noArrayIndent: true };
44+
var todayDate = new Date().toISOString().slice(0,10);
45+
output = "# AUTOGENERATED FROM GITHUB API. DO NOT EDIT\n"
46+
output += "# Releases last updated " + todayDate + " \n";
47+
output += yaml.dump({ releases: releasesUpdated }, options);
48+
fs.writeFileSync(path.resolve(__dirname, `../src/_data/changelogs/${library}.yml`), output);
49+
}
50+
51+
libraries.forEach(library => {
52+
updateLog(library);
53+
});

src/_data/catalog/destination_categories.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
2-
# destination categories last updated 2023-09-26
2+
# destination categories last updated 2023-09-28
33
items:
44
- display_name: A/B Testing
55
slug: a-b-testing

0 commit comments

Comments
 (0)