Add back deprecated runners with warning (#348)

Add back deprecated elements, with a warning on support/maintenance
This commit is contained in:
Paulo F. Oliveira
2025-06-25 00:13:39 +01:00
committed by GitHub
parent b29c86feb9
commit a8bc27ec39
2 changed files with 50 additions and 18 deletions
+25 -9
View File
@@ -611,17 +611,33 @@ function getRunnerOSVersion() {
macos14: 'macOS-14',
macos15: 'macOS-15',
}
const deprecatedImageOSToContainer = {
ubuntu18: 'ubuntu-18.04',
ubuntu20: 'ubuntu-20.04',
}
const containerFromEnvImageOS = ImageOSToContainer[process.env.ImageOS]
if (!containerFromEnvImageOS) {
throw new Error(
"Tried to map a target OS from env. variable 'ImageOS' (got " +
`${process.env.ImageOS}` +
"), but failed. If you're using a " +
"self-hosted runner, you should set 'env': 'ImageOS': ... to one of the following: " +
"['" +
`${Object.keys(ImageOSToContainer).join("', '")}` +
"']",
)
const deprecatedContainerFromEnvImageOS =
deprecatedImageOSToContainer[process.env.ImageOS]
if (deprecatedContainerFromEnvImageOS) {
core.warning(
`You are using deprecated ImageOS ${deprecatedContainerFromEnvImageOS}. ` +
'Support for maintenance is very limited. Consider a non-deprecated version as ' +
'mentioned in the README.md.',
)
return deprecatedContainerFromEnvImageOS
} else {
throw new Error(
"Tried to map a target OS from env. variable 'ImageOS' (got " +
`${process.env.ImageOS}` +
"), but failed. If you're using a " +
"self-hosted runner, you should set 'env': 'ImageOS': ... to one of the following: " +
"['" +
`${Object.keys(ImageOSToContainer).join("', '")}` +
"']",
)
}
}
return containerFromEnvImageOS