Files
pydantic--pydantic-ai/.github/scripts/install-sandbox-tools.sh
T
wehub-resource-sync 9201ef759e
CI / lint (push) Waiting to run
CI / mypy (push) Waiting to run
CI / docs (push) Waiting to run
CI / test on 3.10 (standard) (push) Waiting to run
CI / test on 3.11 (standard) (push) Waiting to run
CI / test on 3.12 (standard) (push) Waiting to run
CI / test on 3.10 (all-extras) (push) Waiting to run
CI / test on 3.11 (all-extras) (push) Waiting to run
CI / test on 3.12 (all-extras) (push) Waiting to run
CI / test on 3.13 (all-extras) (push) Waiting to run
CI / test on 3.14 (pydantic-evals) (push) Waiting to run
Harness Compat / harness compat (push) Waiting to run
CI / test on 3.13 (standard) (push) Waiting to run
CI / test on 3.14 (standard) (push) Waiting to run
CI / test on 3.14 (all-extras) (push) Waiting to run
CI / test on 3.10 (pydantic-ai-slim) (push) Waiting to run
CI / test on 3.11 (pydantic-ai-slim) (push) Waiting to run
CI / test on 3.12 (pydantic-ai-slim) (push) Waiting to run
CI / test on 3.13 (pydantic-ai-slim) (push) Waiting to run
CI / test on 3.14 (pydantic-ai-slim) (push) Waiting to run
CI / test on 3.10 (pydantic-evals) (push) Waiting to run
CI / test on 3.11 (pydantic-evals) (push) Waiting to run
CI / test on 3.12 (pydantic-evals) (push) Waiting to run
CI / test on 3.13 (pydantic-evals) (push) Waiting to run
CI / test on 3.10 (lowest-versions) (push) Waiting to run
CI / test on 3.11 (lowest-versions) (push) Waiting to run
CI / test on 3.12 (lowest-versions) (push) Waiting to run
CI / test on 3.13 (lowest-versions) (push) Waiting to run
CI / test on 3.14 (lowest-versions) (push) Waiting to run
CI / test examples on 3.11 (push) Waiting to run
CI / test examples on 3.12 (push) Waiting to run
CI / test examples on 3.13 (push) Waiting to run
CI / test examples on 3.14 (push) Waiting to run
CI / coverage (push) Blocked by required conditions
CI / check (push) Blocked by required conditions
CI / deploy-docs (push) Blocked by required conditions
CI / deploy-docs-preview (push) Blocked by required conditions
CI / build release artifacts (push) Blocked by required conditions
CI / publish to PyPI (push) Blocked by required conditions
CI / Send tweet (push) Blocked by required conditions
chore: import upstream snapshot with attribution
2026-07-13 13:27:52 +08:00

42 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# Install tools that the agent needs inside the AWF sandbox.
#
# Runs in `pre-agent-steps` (on the runner, open network, after checkout)
# before AWF starts the firewalled container. Tools are exposed via:
#
# 1. /opt/hostedtoolcache/gh-aw-tools/current/x64/bin — AWF auto-scans
# hostedtoolcache bin dirs and merges them into the container PATH.
# 2. $GITHUB_PATH — AWF reads this file at container startup and merges
# entries into AWF_HOST_PATH (the container's PATH).
#
# This follows the pattern used by elastic/ai-github-actions.
set -euo pipefail
toolcache_bin="/opt/hostedtoolcache/gh-aw-tools/current/x64/bin"
sudo mkdir -p "$toolcache_bin"
# --- ripgrep ---
# The agent's native Grep tool wraps `rg` for fast code search.
echo "[install-sandbox-tools] Installing ripgrep..."
uv tool install ripgrep --force --quiet
rg_path="$(uv tool dir --bin)/rg"
if [ -x "$rg_path" ]; then
sudo ln -sf "$rg_path" "$toolcache_bin/rg"
echo "[install-sandbox-tools] rg -> $toolcache_bin/rg"
else
echo "::warning::ripgrep install succeeded but rg binary not found at $rg_path"
fi
# --- uv ---
# Symlink uv into the toolcache so the launcher and Bash tool can find it.
uv_path="$(command -v uv)"
if [ -n "$uv_path" ]; then
sudo ln -sf "$uv_path" "$toolcache_bin/uv"
echo "[install-sandbox-tools] uv -> $toolcache_bin/uv"
fi
# Belt-and-suspenders: also write to $GITHUB_PATH so AWF's GITHUB_PATH
# merge picks it up (works on AWF versions that support this).
echo "$toolcache_bin" >> "${GITHUB_PATH:-/dev/null}"
echo "[install-sandbox-tools] Added $toolcache_bin to GITHUB_PATH"