const commitInfoElement = document.getElementById('commit-info'); fetch('https://api.github.com/repos/ghndrx/docker-test-image/commits') .then(response => response.json()) .then(data => { if (data.length > 0) { const latestCommit = data[0]; const commitMessage = latestCommit.commit.message; const commitAuthor = latestCommit.commit.author.name; const commitDate = new Date(latestCommit.commit.author.date).toLocaleString(); commitInfoElement.innerHTML = `
Message: ${commitMessage}
Author: ${commitAuthor}
Date: ${commitDate}
`; } else { commitInfoElement.innerHTML = 'No commits found.
'; } }) .catch(error => { commitInfoElement.innerHTML = 'Error loading commit information.
'; console.error(error); });