name: ci run-name: "ci ยท ${{ github.event.pull_request.title || github.sha }}" # Lint the very scripts every agent run executes. A single unchecked shell bug here breaks ALL # agents in ALL repos at once (e.g. the ${VAR:-{}} brace bug shellcheck flags as SC1083/SC2321), # so PRs must pass: bash -n + shellcheck on every script, YAML-parse on every workflow, and a # schema check on agents.json (the routing registry). on: pull_request: push: branches: [main] jobs: lint: runs-on: ci-runner steps: - uses: actions/checkout@v4 - name: Install linters run: | command -v shellcheck >/dev/null || (apt-get update -qq && apt-get install -y -qq shellcheck) || \ sudo sh -c 'apt-get update -qq && apt-get install -y -qq shellcheck' || true python3 -c 'import yaml' 2>/dev/null || pip3 install --quiet pyyaml || \ (apt-get install -y -qq python3-yaml || sudo apt-get install -y -qq python3-yaml) || true - name: bash -n (syntax) โ€” every script run: | set -e for f in .gitea/workflows/scripts/*.sh; do bash -n "$f" && echo "OK $f"; done - name: shellcheck โ€” every script run: | set -e if command -v shellcheck >/dev/null; then # error-severity only: the scripts intentionally use unquoted word-splitting in places; # errors (real breakage like the ${x:-{}} brace bug) must fail the build. shellcheck -S error .gitea/workflows/scripts/*.sh && echo "shellcheck clean (severity=error)" else echo "shellcheck unavailable on runner โ€” skipped" fi - name: YAML-parse every workflow run: | set -e python3 - <<'EOF' import glob, sys, yaml for f in sorted(glob.glob('.gitea/workflows/*.yml')): yaml.safe_load(open(f)) print('OK', f) EOF - name: Validate agents.json (registry schema) run: | set -e jq -e 'to_entries | all(.value | (.model|type=="string") and (.mode=="pr" or .mode=="comment") and (.vision|type=="boolean") and (.skills|type=="array") and (.desc|type=="string"))' \ .gitea/workflows/scripts/agents.json >/dev/null && echo "agents.json OK"