Skip to content

Commit

Permalink
Update main.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbhmr authored Aug 16, 2023
1 parent 9bf7b15 commit 92fdb28
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,34 @@ if (latest) {
${image}:${devcontainerFeature.version} \
${image}:latest`;
}

for (const id of devcontainerFeature.legacyIds ?? []) {
const legacyImage = core.getInput("image").replace("*", id);
if (legacyImage === image) {
continue;
}

await $`oras push \
--config /dev/null:application/vnd.devcontainers \
--annotation-file ${annotationsPath} \
${legacyImage}:${devcontainerFeature.version} \
${archivePath}:application/vnd.devcontainers.layer.v1+tar`;

const [major, minor, patch] = devcontainerFeature.version
.split(".")
.map((x) => parseInt(x));

await $`oras tag \
${legacyImage}:${devcontainerFeature.version} \
${legacyImage}:${major}.${minor}`;

await $`oras tag \
${legacyImage}:${devcontainerFeature.version} \
${legacyImage}:${major}`;

if (latest) {
await $`oras tag \
${legacyImage}:${devcontainerFeature.version} \
${legacyImage}:latest`;
}
}

0 comments on commit 92fdb28

Please sign in to comment.