neiam fork: default ImageOS to ubuntu-24.04 for self-hosted forgejo runners
806cbc3 · gmorell · 2026-07-02 02:36
Message
{commit_body(@commit)}
Files changed
modified
dist/index.js
+10
−8
@@ -38527,15 +38527,17 @@ function getRunnerOSVersion() {
| 38527 | 38527 | |
| 38528 | 38528 | return deprecatedContainerFromEnvImageOS |
| 38529 | 38529 | } else { |
| 38530 | − throw new Error( | |
| 38531 | − "Tried to map a target OS from env. variable 'ImageOS' (got " + | |
| 38532 | − `${process.env.ImageOS}` + | |
| 38533 | − "), but failed. If you're using a " + | |
| 38534 | − "self-hosted runner, you should set 'env': 'ImageOS': ... to one of the following: " + | |
| 38535 | − "['" + | |
| 38536 | − `${Object.keys(ImageOSToContainer).join("', '")}` + | |
| 38537 | − "']", | |
| 38530 | + // neiam fork: self-hosted forgejo/act runners derive ImageOS from the | |
| 38531 | + // runs-on label (e.g. 'arcrunner-set') and overwrite any env we set, | |
| 38532 | + // which upstream treats as fatal. Our runner's catthehacker act image | |
| 38533 | + // is Ubuntu 24.04, so fall back to that instead of erroring. A valid | |
| 38534 | + // ImageOS (mapped above) is still honoured. | |
| 38535 | + warning( | |
| 38536 | + `Unmappable ImageOS '${process.env.ImageOS}' on a self-hosted runner; ` + | |
| 38537 | + 'defaulting to ubuntu-24.04. Set a mappable env.ImageOS to override.', | |
| 38538 | 38538 | ) |
| 38539 | + | |
| 38540 | + return 'ubuntu-24.04' | |
| 38539 | 38541 | } |
| 38540 | 38542 | } |
| 38541 | 38543 |
modified
src/setup-beam.js
+10
−8
@@ -696,15 +696,17 @@ function getRunnerOSVersion() {
| 696 | 696 | |
| 697 | 697 | return deprecatedContainerFromEnvImageOS |
| 698 | 698 | } else { |
| 699 | − throw new Error( | |
| 700 | − "Tried to map a target OS from env. variable 'ImageOS' (got " + | |
| 701 | − `${process.env.ImageOS}` + | |
| 702 | − "), but failed. If you're using a " + | |
| 703 | − "self-hosted runner, you should set 'env': 'ImageOS': ... to one of the following: " + | |
| 704 | − "['" + | |
| 705 | − `${Object.keys(ImageOSToContainer).join("', '")}` + | |
| 706 | − "']", | |
| 699 | + // neiam fork: self-hosted forgejo/act runners derive ImageOS from the | |
| 700 | + // runs-on label (e.g. 'arcrunner-set') and overwrite any env we set, | |
| 701 | + // which upstream treats as fatal. Our runner's catthehacker act image | |
| 702 | + // is Ubuntu 24.04, so fall back to that instead of erroring. A valid | |
| 703 | + // ImageOS (mapped above) is still honoured. | |
| 704 | + core.warning( | |
| 705 | + `Unmappable ImageOS '${process.env.ImageOS}' on a self-hosted runner; ` + | |
| 706 | + 'defaulting to ubuntu-24.04. Set a mappable env.ImageOS to override.', | |
| 707 | 707 | ) |
| 708 | + | |
| 709 | + return 'ubuntu-24.04' | |
| 708 | 710 | } |
| 709 | 711 | } |
| 710 | 712 |
Parents: 50a47d8