Skip to content

Add back deprecated runners with warning #348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 25 additions & 9 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26486,17 +26486,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
Expand Down
34 changes: 25 additions & 9 deletions src/setup-beam.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down