Skip to content

Commit 845c6e1

Browse files
authored
Fix release script issue (#5459)
1 parent 46f771e commit 845c6e1

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

extra/release/lib.mjs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,30 @@ export function buildImage(repoNames, tags, target, buildArgs = "", dockerfile =
101101
/**
102102
* Check if the version already exists on Docker Hub
103103
* TODO: use semver to compare versions if it is greater than the previous?
104-
* @param {string} repoName Docker Hub repository name
104+
* @param {string[]} repoNames repository name (Only check the name with single slash)
105105
* @param {string} version Version to check
106106
* @returns {void}
107107
*/
108-
export async function checkTagExists(repoName, version) {
109-
console.log(`Checking if version ${version} exists on Docker Hub`);
108+
export async function checkTagExists(repoNames, version) {
109+
// Skip if the tag is not on Docker Hub
110+
// louislam/uptime-kuma
111+
let dockerHubRepoNames = repoNames.filter((name) => {
112+
return name.split("/").length === 2;
113+
});
114+
115+
for (let repoName of dockerHubRepoNames) {
116+
await checkTagExistsSingle(repoName, version);
117+
}
118+
}
119+
120+
/**
121+
* Check if the version already exists on Docker Hub
122+
* @param {string} repoName repository name
123+
* @param {string} version Version to check
124+
* @returns {Promise<void>}
125+
*/
126+
export async function checkTagExistsSingle(repoName, version) {
127+
console.log(`Checking if version ${version} exists on Docker Hub:`, repoName);
110128

111129
// Get a list of tags from the Docker Hub repository
112130
let tags = [];

0 commit comments

Comments
 (0)