{"id":15941543,"url":"https://github.com/carlkidcrypto/os-specific-runner","last_synced_at":"2026-04-24T21:31:19.696Z","repository":{"id":212685746,"uuid":"732073684","full_name":"carlkidcrypto/os-specific-runner","owner":"carlkidcrypto","description":"os-specific-runner","archived":false,"fork":false,"pushed_at":"2026-04-23T02:53:51.000Z","size":1202,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-23T04:23:47.462Z","etag":null,"topics":["continuous-integration","github-actions","os-runner","os-specific","os-specific-run","os-specific-runner","utilities"],"latest_commit_sha":null,"homepage":"https://carlkidcrypto.github.io/os-specific-runner/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carlkidcrypto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"carlkidcrypto","thanks_dev":null,"custom":null}},"created_at":"2023-12-15T15:20:01.000Z","updated_at":"2026-04-23T02:53:53.000Z","dependencies_parsed_at":"2026-04-07T06:07:00.808Z","dependency_job_id":null,"html_url":"https://github.com/carlkidcrypto/os-specific-runner","commit_stats":null,"previous_names":["carlkidcrypto/carlkidcrypto-os-specific-run-2","carlkidcrypto/carlkidcrypto-os-specific-runner","carlkidcrypto/os-specific-runner"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/carlkidcrypto/os-specific-runner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlkidcrypto%2Fos-specific-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlkidcrypto%2Fos-specific-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlkidcrypto%2Fos-specific-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlkidcrypto%2Fos-specific-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carlkidcrypto","download_url":"https://codeload.github.com/carlkidcrypto/os-specific-runner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlkidcrypto%2Fos-specific-runner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32241544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["continuous-integration","github-actions","os-runner","os-specific","os-specific-run","os-specific-runner","utilities"],"created_at":"2024-10-07T07:05:19.440Z","updated_at":"2026-04-24T21:31:19.687Z","avatar_url":"https://github.com/carlkidcrypto.png","language":"JavaScript","funding_links":["https://buymeacoffee.com/carlkidcrypto","https://www.buymeacoffee.com/carlkidcrypto"],"categories":[],"sub_categories":[],"readme":"# os-specific-runner\n\nAll credit for the original work goes to [KnicKnic](https://github.com/KnicKnic). This is a detached-fork of \u003chttps://github.com/KnicKnic/os-specific-run\u003e.\nThis version (2.2.0 and beyond) will attempt to stay up to date on the latest version of NPM and other dependencies.\n\n## Status Badge(s)\n\n| [![unit_tests](https://github.com/carlkidcrypto/os-specific-runner/actions/workflows/unit_tests.yml/badge.svg)](https://github.com/carlkidcrypto/os-specific-runner/actions/workflows/unit_tests.yml) | [![integration_tests](https://github.com/carlkidcrypto/os-specific-runner/actions/workflows/integration_tests.yml/badge.svg)](https://github.com/carlkidcrypto/os-specific-runner/actions/workflows/integration_tests.yml) | [![CodeQL](https://github.com/carlkidcrypto/os-specific-runner/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/carlkidcrypto/os-specific-runner/actions/workflows/github-code-scanning/codeql) |\n| --------------- | --------------- | --------------- |\n| [![regenerate](https://github.com/carlkidcrypto/os-specific-runner/actions/workflows/regenerate.yml/badge.svg)](https://github.com/carlkidcrypto/os-specific-runner/actions/workflows/regenerate.yml) | [![codecov](https://codecov.io/gh/carlkidcrypto/os-specific-runner/graph/badge.svg)](https://codecov.io/gh/carlkidcrypto/os-specific-runner) | [![total download count](https://img.shields.io/github/downloads/carlkidcrypto/os-specific-runner/total.svg?style=flat-square\u0026label=all%20downloads)](https://github.com/carlkidcrypto/os-specific-runner/releases) |\n| [![latest release download count](https://img.shields.io/github/downloads/carlkidcrypto/os-specific-runner/v2.3.0/total.svg?style=flat-square)](https://github.com/carlkidcrypto/os-specific-runner/releases/tag/v2.3.0) | | |\n\n## AI Contributions\n\nSee [HOWTOAI.rst](HOWTOAI.rst) for a practical guide on using AI coding assistants to contribute to this project.\n\n## How to Support This Project\n\n\u003ca href=\"https://www.buymeacoffee.com/carlkidcrypto\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\u003c/a\u003e\n\n## About\n\nA GitHub Action that runs a different shell command depending on which OS the runner is using. The platform is detected via Node.js [`os.platform()`](https://nodejs.org/api/os.html#osplatform). All 7 platforms supported by that API are covered.\n\n```yaml\n    - uses: carlkidcrypto/os-specific-runner@v2.3.0\n      with:\n        linux:   echo \"Hi from Linux\"\n        macos:   echo \"Hi from macOS\"\n        windows: echo \"Hi from Windows\"\n        aix:     echo \"Hi from AIX\"\n        freebsd: echo \"Hi from FreeBSD\"\n        openbsd: echo \"Hi from OpenBSD\"\n        sunos:   echo \"Hi from SunOS\"\n```\n\n## Keeping actions up-to-date\n\nEnable Dependabot to get notifications for updated actions by creating [.github/dependabot.yml](https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates#about-the-dependabotyml-file) in your repository with the [actions configuration](https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot#enabling-dependabot-version-updates-for-actions).\n\n## Params\n\n### Command inputs (all optional)\n\nEach input accepts a shell command string. When omitted, a no-op `echo` is run so the step never fails silently.\n\n| Input     | Default shell | Default command                          |\n|-----------|---------------|------------------------------------------|\n| `linux`   | `bash`        | `echo \"No command specified for linux\"`  |\n| `macos`   | `zsh`         | `echo \"No command specified for macos\"`  |\n| `windows` | `pwsh`        | `echo \"No command specified for windows\"`|\n| `aix`     | `sh`          | `echo \"No command specified for aix\"`    |\n| `freebsd` | `sh`          | `echo \"No command specified for freebsd\"`|\n| `openbsd` | `sh`          | `echo \"No command specified for openbsd\"`|\n| `sunos`   | `sh`          | `echo \"No command specified for sunos\"`  |\n\n### Shell override inputs (all optional)\n\nOverride the shell used to execute a platform's command. Any value accepted by the GitHub Actions\n[`shell` field](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell)\nworks here, including custom shell paths.\n\n| Input          | Default  | Available choices                                |\n|----------------|----------|--------------------------------------------------|\n| `linuxShell`   | `bash`   | `bash`, `sh`, `python`, `python3`, or any path   |\n| `macosShell`   | `zsh`    | `zsh`, `bash`, `python`, `python3`, or any path  |\n| `windowsShell` | `pwsh`   | `pwsh`, `powershell`, `cmd`, `python`, `python3` |\n| `aixShell`     | `sh`     | `sh`, `bash`, `python`, `python3`, or any path   |\n| `freebsdShell` | `sh`     | `sh`, `bash`, `python`, `python3`, or any path   |\n| `openbsdShell` | `sh`     | `sh`, `bash`, `python`, `python3`, or any path   |\n| `sunosShell`   | `sh`     | `sh`, `bash`, `python`, `python3`, or any path   |\n\n**Built-in shell templates** (expanded automatically when you use one of these names):\n\n| Shell name    | Expanded template                              |\n|---------------|------------------------------------------------|\n| `bash`        | `bash --noprofile --norc -eo pipefail {0}`     |\n| `sh`          | `sh -e {0}`                                    |\n| `zsh`         | `zsh -e {0}`                                   |\n| `pwsh`        | `pwsh -command \"\u0026 '{0}'\"`                      |\n| `powershell`  | `powershell -command \"\u0026 '{0}'\"`                |\n| `cmd`         | `cmd.exe /D /E:ON /V:OFF /S /C \"CALL \"{0}\"\"` |\n| `python`      | `python {0}`                                   |\n| `python3`     | `python3 {0}`                                  |\n\nAny other value is passed through as a raw shell command string.\n\n### Other inputs\n\n| Input               | Required | Default | Description                                              |\n|---------------------|----------|---------|----------------------------------------------------------|\n| `working_directory` | No       | `\"\"`    | Path from which to run the command. Empty = temp dir.    |\n\n## Practical Examples\n\n### Basic cross-platform greeting\n\nThe three standard GitHub-hosted runners (Linux, macOS, Windows):\n\n```yaml\n    - uses: carlkidcrypto/os-specific-runner@v2.3.0\n      with:\n        linux:   echo \"Hello from Linux\"\n        macos:   echo \"Hello from macOS\"\n        windows: echo \"Hello from Windows\"\n```\n\n### Multi-line commands\n\nUse YAML's `|` block-scalar syntax to write multi-line scripts:\n\n```yaml\n    - uses: carlkidcrypto/os-specific-runner@v2.3.0\n      with:\n        linux: |\n          echo \"Setting up on Linux...\"\n          sudo apt-get update -y\n          sudo apt-get install -y curl jq\n          echo \"Done.\"\n        macos: |\n          echo \"Setting up on macOS...\"\n          brew update\n          brew install curl jq\n          echo \"Done.\"\n        windows: |\n          Write-Host \"Setting up on Windows...\"\n          choco install curl jq -y\n          Write-Host \"Done.\"\n```\n\n### Choosing a specific shell\n\nOverride the default shell per platform using the `*Shell` inputs:\n\n```yaml\n    - uses: carlkidcrypto/os-specific-runner@v2.3.0\n      with:\n        linux:        echo \"Running under sh on Linux\"\n        linuxShell:   sh\n        macos:        echo \"Running under bash on macOS\"\n        macosShell:   bash\n        windows:      'echo Running under cmd on Windows'\n        windowsShell: cmd\n```\n\n### Running a Python script\n\nSet any platform's shell to `python3` (Linux/macOS) or `python` (Windows) to execute the command string as Python code directly. The script is saved to a temporary `.py` file and passed to the interpreter:\n\n```yaml\n    - uses: carlkidcrypto/os-specific-runner@v2.3.0\n      with:\n        linux:        \"import platform; print('Linux, Python', platform.python_version())\"\n        linuxShell:   python3\n        macos:        \"import platform; print('macOS, Python', platform.python_version())\"\n        macosShell:   python3\n        windows:      \"import platform; print('Windows, Python', platform.python_version())\"\n        windowsShell: python\n```\n\n### Using a working directory\n\nUse `working_directory` to run commands from a specific path in your repository:\n\n```yaml\n    - uses: actions/checkout@v4\n\n    - uses: carlkidcrypto/os-specific-runner@v2.3.0\n      with:\n        working_directory: ./scripts\n        linux: bash build.sh\n        macos: bash build.sh\n        windows: pwsh build.ps1\n```\n\n### All platforms\n\nA snippet that covers every platform supported by `os.platform()`, useful when targeting self-hosted exotic runners:\n\n```yaml\n    - uses: carlkidcrypto/os-specific-runner@v2.3.0\n      with:\n        linux:   echo \"Linux runner\"\n        macos:   echo \"macOS runner\"\n        windows: echo \"Windows runner\"\n        aix:     echo \"IBM AIX runner\"\n        freebsd: echo \"FreeBSD runner\"\n        openbsd: echo \"OpenBSD runner\"\n        sunos:   echo \"SunOS/Solaris runner\"\n```\n\n## Full Example\n\nA realistic workflow that installs Node.js, checks out code, and runs OS-specific build steps from a dedicated directory:\n\n```yaml\nname: Build\n\non:\n  push:\n    branches: [ master ]\n  pull_request:\n    branches: [ master ]\n\njobs:\n  build:\n    runs-on: ${{ matrix.os }}\n    strategy:\n      matrix:\n        os: [\"ubuntu-latest\", \"windows-latest\", \"macos-latest\"]\n\n    steps:\n      - uses: actions/checkout@v4\n\n      - uses: actions/setup-node@v4\n        with:\n          node-version: '24'\n\n      - name: Install dependencies\n        uses: carlkidcrypto/os-specific-runner@v2.3.0\n        with:\n          working_directory: ./app\n          linux: |\n            npm ci\n            echo \"Linux deps installed\"\n          macos: |\n            npm ci\n            echo \"macOS deps installed\"\n          windows: |\n            npm ci\n            Write-Host \"Windows deps installed\"\n\n      - name: Build\n        uses: carlkidcrypto/os-specific-runner@v2.3.0\n        with:\n          working_directory: ./app\n          linux:   npm run build\n          macos:   npm run build\n          windows: npm run build\n```\n\n## Alternatives\n\nYou can do what this project accomplishes with simple `if` statements in GitHub Actions.\n\nThe problem is you have to figure them out, and they end up creating multiple steps — one per each OS — most of which are skipped at runtime. A single step (rather than multiple skipped steps) looks cleaner and makes it more obvious what failed. More details on `if` statements: \u003chttps://github.community/t/what-is-the-correct-if-condition-syntax-for-checking-matrix-os-version/16221/4\u003e\n\n## Developer instructions\n\n### Setup Environment\n\n```pwsh\nnpm install -g npm@11.6.2\nnpm install -g @vercel/ncc@0.38.4\nnpm install\n```\n\n### Update lock file\n\n```pwsh\nnpm update\n```\n\n### Update project\n\n```pwsh\nncc build index.js -m\n```\n\n### Run tests\n\nUnit tests run locally with:\n\n```pwsh\nnpm test\n```\n\nIntegration tests and unit tests also run as workflows. See `unit_tests.yml` and `integration_tests.yml` for more information.\n\n---\n\n\u003e This content was generated by AI and reviewed by humans. Mistakes may still occur. PRs for corrections are welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlkidcrypto%2Fos-specific-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarlkidcrypto%2Fos-specific-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlkidcrypto%2Fos-specific-runner/lists"}