mirror of
https://github.com/ghndrx/docker-test-image.git
synced 2026-02-10 06:45:05 +00:00
Updated script for content
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
window.addEventListener('DOMContentLoaded', async () => {
|
window.addEventListener('DOMContentLoaded', async () => {
|
||||||
const repository = 'ghndrx/docker-test-image'; // Replace with your desired repository
|
const repository = 'ghndrx/docker-test-image'; // Replace with your desired repository
|
||||||
|
const commitCount = 5; // Number of commits to display
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`https://api.github.com/repos/${repository}/commits`);
|
const response = await fetch(`https://api.github.com/repos/${repository}/commits?per_page=${commitCount}`);
|
||||||
const commits = await response.json();
|
const commits = await response.json();
|
||||||
|
|
||||||
const commitList = document.getElementById('commit-list');
|
const commitList = document.getElementById('commit-list');
|
||||||
@@ -12,8 +13,9 @@ window.addEventListener('DOMContentLoaded', async () => {
|
|||||||
const commitElement = document.createElement('div');
|
const commitElement = document.createElement('div');
|
||||||
commitElement.classList.add('commit');
|
commitElement.classList.add('commit');
|
||||||
commitElement.innerHTML = `
|
commitElement.innerHTML = `
|
||||||
<p><strong>${commit.commit.author.name}</strong></p>
|
<p><strong>Commit: </strong>${commit.sha}</p>
|
||||||
<p>${commit.commit.message}</p>
|
<p><strong>Date: </strong>${commit.commit.author.date}</p>
|
||||||
|
<p><strong>Message: </strong>${commit.commit.message}</p>
|
||||||
`;
|
`;
|
||||||
commitList.appendChild(commitElement);
|
commitList.appendChild(commitElement);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user