Skip to content
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