-
Notifications
You must be signed in to change notification settings - Fork 0
/
about.js
19 lines (16 loc) · 848 Bytes
/
about.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const username = 'linfindel';
const repo = 'images';
fetch(`https://api.github.com/repos/${username}/${repo}/commits?per_page=1`)
.then(response => {
const totalCount = response.headers.get('Link').match(/page=(\d+)>; rel="last"/)[1] / 100;
return response.json().then(data => {
const latestCommitMessage = data[0].commit.message;
console.log(`Total commit count: ${totalCount}`);
console.log(`Latest commit message: ${latestCommitMessage}`);
document.getElementById("version").innerText = `Version ${totalCount.toFixed(2)} Release Notes`;
document.getElementById("whats-new").innerText = latestCommitMessage;
document.getElementById("about-card").style.opacity = "1";
document.getElementById("about-card").style.pointerEvents = "all";
});
})
.catch(error => console.error('Error fetching data:', error));