diff --git a/README.md b/README.md index 8dd1003..16a3a0c 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,10 @@ Following inputs can be used as `step.with` keys | `x` | Bool | `false` | Prints the build commands as compilation progresses | | `ldflags` | String | | Arguments to pass on each go tool link invocation | +## :warning: Limitation + +This action is only available for Linux [virtual environments](https://help.github.com/en/articles/virtual-environments-for-github-actions#supported-virtual-environments-and-hardware-resources). + ## 🤝 How can I help ? All kinds of contributions are welcome :raised_hands:!
diff --git a/lib/main.js b/lib/main.js index 22e3722..892aa57 100644 --- a/lib/main.js +++ b/lib/main.js @@ -17,12 +17,17 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const installer = __importStar(require("./installer")); +const os = __importStar(require("os")); const child_process = __importStar(require("child_process")); const core = __importStar(require("@actions/core")); const exec = __importStar(require("@actions/exec")); function run() { return __awaiter(this, void 0, void 0, function* () { try { + if (os.platform() !== 'linux') { + core.setFailed('Only supported on linux platform'); + return; + } const workspace = process.env['GITHUB_WORKSPACE'] || '.'; const xgo_version = core.getInput('xgo_version') || 'latest'; const go_version = core.getInput('go_version'); diff --git a/src/main.ts b/src/main.ts index 39676e4..c2caa46 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,10 +1,16 @@ import * as installer from './installer'; +import * as os from 'os'; import * as child_process from 'child_process'; import * as core from '@actions/core'; import * as exec from '@actions/exec'; async function run() { try { + if (os.platform() !== 'linux') { + core.setFailed('Only supported on linux platform'); + return; + } + const workspace = process.env['GITHUB_WORKSPACE'] || '.'; const xgo_version = core.getInput('xgo_version') || 'latest'; const go_version = core.getInput('go_version');