36 lines
1.1 KiB
YAML
36 lines
1.1 KiB
YAML
kind: pipeline
|
|
name: release
|
|
|
|
steps:
|
|
- name: run
|
|
image: node:14
|
|
commands:
|
|
- |
|
|
const axios = require("axios");
|
|
|
|
function getLatestReleaseTag() {
|
|
const repoOwner = "insignia-live";
|
|
const repoName = "setup-assistant-release";
|
|
|
|
return axios
|
|
.get(`https://api.github.com/repos/${repoOwner}/${repoName}/releases/latest`)
|
|
.then((response) => 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
|
|
});
|
|
}
|
|
|
|
getLatestReleaseTag().then((latestReleaseTag) => {
|
|
const targetReleaseTag = "2023-02-13-1223";
|
|
|
|
if (latestReleaseTag > targetReleaseTag) {
|
|
console.log("This pipeline is run because the new release is newer than the one I have.");
|
|
} else if (latestReleaseTag === targetReleaseTag) {
|
|
console.log("The release tag is the same as the target tag.");
|
|
} else {
|
|
console.log("The new release is older than the one I have.");
|
|
}
|
|
});
|
|
|