apt-get: not found
Check for APT or apk before calling it.
+ Package names differ by distribution; do not replace them blindly.
diff --git a/README.md b/README.md index fd6f20d..812cda9 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [Live demo](https://mresyzz.github.io/opsscript-gate/) · [简体中文](README.zh-CN.md) · [Configuration](docs/configuration.md) · [Troubleshooting](docs/troubleshooting.md) · [Self-hosted model installer guide](docs/gpt-oss.md) -> **OpsScript Gate is a cross-distro shell script runtime compatibility checker.** Use it for cross-distro shell testing: the GitHub Action and Python CLI run shell installers in real Debian, Ubuntu, and Alpine containers. ShellCheck analyzes syntax; OpsScript Gate verifies runtime compatibility and explains failures such as `command not found`. +> **OpsScript Gate is a cross-distro shell script runtime compatibility checker.** The GitHub Action and Python CLI test shell installers in real Debian, Ubuntu, and Alpine containers and diagnose failures such as `command not found`. Use it alongside ShellCheck to check both source code and runtime behavior. [](https://github.com/Mresyzz/opsscript-gate/actions/workflows/test.yml) [](https://github.com/Mresyzz/opsscript-gate/actions/workflows/demo.yml) diff --git a/action.yml b/action.yml index a5fa439..7aab255 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ name: 'OpsScript Gate' -description: 'Cross-distro shell testing and runtime compatibility checker for Debian, Ubuntu, and Alpine; GitHub Action catches command not found and other runtime failures.' +description: 'Cross-distro shell script compatibility checker for runtime testing in Debian, Ubuntu, and Alpine. Diagnoses command not found.' author: 'Mresyzz' branding: icon: 'shield' diff --git a/docs/command-not-found.html b/docs/command-not-found.html new file mode 100644 index 0000000..6301bdb --- /dev/null +++ b/docs/command-not-found.html @@ -0,0 +1,122 @@ + + +
+ + +Cross-distro shell script runtime compatibility checker
+OpsScript Gate tests shell scripts in real Debian, Ubuntu, and Alpine containers.
+ It is a GitHub Action and Python CLI that reports each distribution's PASS/FAIL result and
+ diagnoses runtime failures such as command not found.
Use it for standalone installers, bootstrap scripts, and shell entrypoints. You supply the script; + the tool runs the distribution matrix and collects the diagnostic report.
+ Add the runtime check to CI + +Save this as install.sh. The syntax is valid POSIX shell, but Alpine uses
+ apk and does not supply apt-get in its standard image.
#!/bin/sh
+set -eu
+apt-get --version
+ Expected outcome for this example; this page does not execute containers in your browser.
+| Image | Result | Diagnostic |
|---|---|---|
debian:12-slim | PASS | Exit 0 |
ubuntu:22.04 | PASS | Exit 0 |
ubuntu:24.04 | PASS | Exit 0 |
alpine:3.20 | FAIL | Exit 127: apt-get: not found, line 3 |
A shell linter checks source code. Executing the script tests which commands actually exist in the target image. + Run both checks to cover source mistakes and runtime assumptions.
+ +Copy this into .github/workflows/shell-runtime.yml and set script-path
+ to your installer. The Ubuntu runner starts the Debian, Ubuntu, and Alpine containers.
name: Shell runtime compatibility
+on: [push, pull_request]
+permissions:
+ contents: read
+jobs:
+ runtime:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - uses: Mresyzz/opsscript-gate@v0.8.3
+ with:
+ script-path: install.sh
+ shell: auto
+ format: markdown
+ output: reports/compatibility.md
+ The report includes the image, exit code, script line where available, missing command, and remediation hint. + GitHub Actions also receives workflow annotations and a Step Summary. + Inspect the project's real CI demo runs.
+ +apt-get: not foundCheck for APT or apk before calling it.
+ Package names differ by distribution; do not replace them blindly.
/bin/bash: not foundMinimal Alpine omits Bash by default. + Use POSIX shell or declare an image or package prerequisite that supplies Bash.
curl or jq missingMinimal images omit many convenience tools.
+ Declare required tools through packages or explain the prerequisite in your installer.
Requires Python 3.10+ and a reachable Docker engine running Linux containers.
+pip install opsscript-gate
+opsscript-gate doctor
+opsscript-gate run ./install.sh
+ The CLI supports table, Markdown, JSON, and SARIF reports.
+ --dry-run previews the plan without Docker; it does not verify runtime compatibility.
ShellCheck analyzes shell source; OpsScript Gate executes it across distributions. A handwritten Docker matrix + can also run scripts, but you maintain its image list, timeouts, log parsing, and reports.
+OpsScript Gate mounts each script independently. Sibling files and repository dependencies are not mounted. + These are distribution user-space tests in containers, not separate Linux kernels or full-machine tests. + Passing checks do not prove security or replace project integration tests.
+ +