From 18432adf74dab6573bee5988d57183e1e42530cb Mon Sep 17 00:00:00 2001 From: qwen-code-dev-bot Date: Wed, 22 Jul 2026 17:17:59 +0800 Subject: [PATCH] feat: add skip_install input for pre-installed CLI runners Add a skip_install input (default: false) that skips the npm/pnpm installation step when the Qwen Code CLI is already pre-installed on the runner (e.g. self-hosted ECS runners). When skip_install is true: - Install pnpm step is skipped - Install Qwen Code step is skipped - A new Verify pre-installed Qwen Code step checks that qwen is in PATH and fails with a clear error if not This avoids redundant per-run installs on runners that maintain a persistent CLI installation, matching the pattern already used in qwen-code Autofix/triage workflows (PR #4866, #6207). --- action.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 09cabcf..12fc215 100644 --- a/action.yml +++ b/action.yml @@ -56,6 +56,10 @@ inputs: description: 'Whether or not to use pnpm instead of npm to install qwen-code' required: false default: 'false' + skip_install: + description: 'Skip installing Qwen Code. Use when the CLI is already pre-installed on the runner (e.g. self-hosted ECS runners).' + required: false + default: 'false' workflow_name: description: 'The GitHub workflow name, used for telemetry purposes.' required: false @@ -129,13 +133,15 @@ runs: - name: 'Install pnpm' if: |- - ${{ inputs.use_pnpm == 'true' }} + ${{ inputs.use_pnpm == 'true' && inputs.skip_install != 'true' }} uses: 'pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061' # ratchet:pnpm/action-setup@v4 with: version: 10 - name: 'Install Qwen Code' id: 'install' + if: |- + ${{ inputs.skip_install != 'true' }} env: QWEN_CLI_VERSION: '${{ inputs.qwen_cli_version }}' EXTENSIONS: '${{ inputs.extensions }}' @@ -180,6 +186,20 @@ runs: done fi + - name: 'Verify pre-installed Qwen Code' + if: |- + ${{ inputs.skip_install == 'true' }} + shell: 'bash' + run: |- + set -euo pipefail + if command -v qwen >/dev/null 2>&1; then + echo "Using pre-installed Qwen Code:" + qwen --version || echo "(version command not available)" + else + echo "::error title=Qwen Code not found::skip_install is true but 'qwen' is not in PATH. Ensure the CLI is pre-installed on this runner." + exit 1 + fi + - name: 'Run Qwen Code' id: 'qwen_run' shell: 'bash'