neiam
/action-setup-beam
action-setup-beam
public · Issues · Pulls · Labels · Forks · Compare · Actions queued
⭐
Log in to mark this repository.
Add back deprecated runners with warning (#348)
a8bc27e · Paulo F. Oliveira · 2025-06-24 23:13
Message
{commit_body(@commit)}
Files changed
modified
dist/index.js
+25
−9
@@ -26486,17 +26486,33 @@ function getRunnerOSVersion() {
| 26486 | 26486 | macos14: 'macOS-14', |
| 26487 | 26487 | macos15: 'macOS-15', |
| 26488 | 26488 | } |
| 26489 | + const deprecatedImageOSToContainer = { | |
| 26490 | + ubuntu18: 'ubuntu-18.04', | |
| 26491 | + ubuntu20: 'ubuntu-20.04', | |
| 26492 | + } | |
| 26489 | 26493 | const containerFromEnvImageOS = ImageOSToContainer[process.env.ImageOS] |
| 26490 | 26494 | 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 | + } | |
| 26500 | 26516 | } |
| 26501 | 26517 | |
| 26502 | 26518 | return containerFromEnvImageOS |
modified
src/setup-beam.js
+25
−9
@@ -611,17 +611,33 @@ function getRunnerOSVersion() {
| 611 | 611 | macos14: 'macOS-14', |
| 612 | 612 | macos15: 'macOS-15', |
| 613 | 613 | } |
| 614 | + const deprecatedImageOSToContainer = { | |
| 615 | + ubuntu18: 'ubuntu-18.04', | |
| 616 | + ubuntu20: 'ubuntu-20.04', | |
| 617 | + } | |
| 614 | 618 | const containerFromEnvImageOS = ImageOSToContainer[process.env.ImageOS] |
| 615 | 619 | 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 | + } | |
| 625 | 641 | } |
| 626 | 642 | |
| 627 | 643 | return containerFromEnvImageOS |
Parents: b29c86f