Skip to content

Commit d3a6a2a

Browse files
Add back deprecated elements, with a warning on support/maintenance
1 parent b29c86f commit d3a6a2a

File tree

2 files changed

+50
-18
lines changed

2 files changed

+50
-18
lines changed

dist/index.js

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26486,17 +26486,33 @@ function getRunnerOSVersion() {
2648626486
macos14: 'macOS-14',
2648726487
macos15: 'macOS-15',
2648826488
}
26489+
const deprecatedImageOSToContainer = {
26490+
ubuntu18: 'ubuntu-18.04',
26491+
ubuntu20: 'ubuntu-20.04',
26492+
}
2648926493
const containerFromEnvImageOS = ImageOSToContainer[process.env.ImageOS]
2649026494
if (!containerFromEnvImageOS) {
26491-
throw new Error(
26492-
"Tried to map a target OS from env. variable 'ImageOS' (got " +
26493-
`${process.env.ImageOS}` +
26494-
"), but failed. If you're using a " +
26495-
"self-hosted runner, you should set 'env': 'ImageOS': ... to one of the following: " +
26496-
"['" +
26497-
`${Object.keys(ImageOSToContainer).join("', '")}` +
26498-
"']",
26499-
)
26495+
const deprecatedContainerFromEnvImageOS =
26496+
deprecatedImageOSToContainer[process.env.ImageOS]
26497+
if (deprecatedContainerFromEnvImageOS) {
26498+
core.warning(
26499+
`You are using deprecated ImageOS ${deprecatedContainerFromEnvImageOS}. ` +
26500+
'Support for maintenance is very limited. Consider a non-deprecated version as ' +
26501+
'mentioned in the README.md.',
26502+
)
26503+
26504+
return deprecatedContainerFromEnvImageOS
26505+
} else {
26506+
throw new Error(
26507+
"Tried to map a target OS from env. variable 'ImageOS' (got " +
26508+
`${process.env.ImageOS}` +
26509+
"), but failed. If you're using a " +
26510+
"self-hosted runner, you should set 'env': 'ImageOS': ... to one of the following: " +
26511+
"['" +
26512+
`${Object.keys(ImageOSToContainer).join("', '")}` +
26513+
"']",
26514+
)
26515+
}
2650026516
}
2650126517

2650226518
return containerFromEnvImageOS

src/setup-beam.js

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -611,17 +611,33 @@ function getRunnerOSVersion() {
611611
macos14: 'macOS-14',
612612
macos15: 'macOS-15',
613613
}
614+
const deprecatedImageOSToContainer = {
615+
ubuntu18: 'ubuntu-18.04',
616+
ubuntu20: 'ubuntu-20.04',
617+
}
614618
const containerFromEnvImageOS = ImageOSToContainer[process.env.ImageOS]
615619
if (!containerFromEnvImageOS) {
616-
throw new Error(
617-
"Tried to map a target OS from env. variable 'ImageOS' (got " +
618-
`${process.env.ImageOS}` +
619-
"), but failed. If you're using a " +
620-
"self-hosted runner, you should set 'env': 'ImageOS': ... to one of the following: " +
621-
"['" +
622-
`${Object.keys(ImageOSToContainer).join("', '")}` +
623-
"']",
624-
)
620+
const deprecatedContainerFromEnvImageOS =
621+
deprecatedImageOSToContainer[process.env.ImageOS]
622+
if (deprecatedContainerFromEnvImageOS) {
623+
core.warning(
624+
`You are using deprecated ImageOS ${deprecatedContainerFromEnvImageOS}. ` +
625+
'Support for maintenance is very limited. Consider a non-deprecated version as ' +
626+
'mentioned in the README.md.',
627+
)
628+
629+
return deprecatedContainerFromEnvImageOS
630+
} else {
631+
throw new Error(
632+
"Tried to map a target OS from env. variable 'ImageOS' (got " +
633+
`${process.env.ImageOS}` +
634+
"), but failed. If you're using a " +
635+
"self-hosted runner, you should set 'env': 'ImageOS': ... to one of the following: " +
636+
"['" +
637+
`${Object.keys(ImageOSToContainer).join("', '")}` +
638+
"']",
639+
)
640+
}
625641
}
626642

627643
return containerFromEnvImageOS

0 commit comments

Comments
 (0)