consolesmods/script.js
Sthope c61d122d3b
Some checks failed
continuous-integration/drone/push Build is failing
Update script.js
2023-08-28 18:26:29 +02:00

23 lines
699 B
JavaScript

const axios = require("axios");
async function getLatestReleaseTag() {
const repoOwner = "insignia-live";
const repoName = "setup-assistant-release";
try {
const response = await axios.get(`https://api.github.com/repos/${repoOwner}/${repoName}/releases/latest`);
return response.data.tag_name;
} catch (error) {
console.error("Error fetching latest release tag:", error.message);
return "0.0.0"; // Return a default value in case of an error
}
}
const latestReleaseTag = getLatestReleaseTag();
const isNewer = semver.gt(latestReleaseTag, "2023-02-13-1223");
if (isNewer) {
console.log("This pipeline is run because the new release is newer than the one I have.");
}