Skip to content

Commit 06702ce

Browse files
Mossakaclaude
andcommitted
feat: bump AWF to v0.25.10 and use lightweight esbuild bundle
Switch from ~50MB pkg binaries to ~357KB esbuild single-file bundle (awf-bundle.js) when Node.js >= 20 is available. GitHub hosted runners always have Node.js 22, so the bundle path is always taken. Falls back to platform-specific pkg binary for self-hosted runners without Node.js. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 251ec57 commit 06702ce

4 files changed

Lines changed: 75 additions & 26 deletions

File tree

actions/setup/sh/install_awf_binary.sh

Lines changed: 66 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
#!/usr/bin/env bash
2-
# Install AWF (Agentic Workflow Firewall) binary with SHA256 checksum verification
2+
# Install AWF (Agentic Workflow Firewall) with SHA256 checksum verification
33
# Usage: install_awf_binary.sh VERSION
44
#
5-
# This script downloads the AWF binary directly from GitHub releases and verifies
5+
# This script downloads the AWF bundle or binary from GitHub releases and verifies
66
# its SHA256 checksum before installation to protect against supply chain attacks.
77
#
88
# Arguments:
9-
# VERSION - AWF version to install (e.g., v0.10.0)
9+
# VERSION - AWF version to install (e.g., v0.25.10)
1010
#
11-
# Platform support:
11+
# Install strategy:
12+
# 1. If Node.js >= 20 is available, download the lightweight awf-bundle.js (~357KB)
13+
# 2. Otherwise, fall back to platform-specific pkg binary (~50MB)
14+
#
15+
# Platform support (fallback binary):
1216
# - Linux (x64, arm64): Downloads pre-built binary
1317
# - macOS (x64, arm64): Downloads pre-built binary
1418
#
1519
# Security features:
16-
# - Downloads binary directly from GitHub releases
20+
# - Downloads directly from GitHub releases
1721
# - Verifies SHA256 checksum against official checksums.txt
1822
# - Fails fast if checksum verification fails
1923
# - Eliminates trust dependency on installer scripts
@@ -25,6 +29,7 @@ AWF_VERSION="${1:-}"
2529
AWF_REPO="github/gh-aw-firewall"
2630
AWF_INSTALL_DIR="/usr/local/bin"
2731
AWF_INSTALL_NAME="awf"
32+
AWF_LIB_DIR="/usr/local/lib/awf"
2833

2934
if [ -z "$AWF_VERSION" ]; then
3035
echo "ERROR: AWF version is required"
@@ -88,6 +93,44 @@ verify_checksum() {
8893
echo "✓ Checksum verification passed for ${fname}"
8994
}
9095

96+
# Check if Node.js >= 20 is available
97+
has_node_20() {
98+
if ! command -v node &>/dev/null; then
99+
return 1
100+
fi
101+
local node_major
102+
node_major=$(node --version | sed 's/^v//' | cut -d. -f1)
103+
if [ "$node_major" -ge 20 ] 2>/dev/null; then
104+
return 0
105+
fi
106+
return 1
107+
}
108+
109+
install_bundle() {
110+
local bundle_name="awf-bundle.js"
111+
local bundle_url="${BASE_URL}/${bundle_name}"
112+
113+
echo "Node.js >= 20 detected ($(node --version)), using lightweight bundle..."
114+
echo "Downloading bundle from ${bundle_url@Q}..."
115+
curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/${bundle_name}" "${bundle_url}"
116+
117+
# Verify checksum
118+
verify_checksum "${TEMP_DIR}/${bundle_name}" "${bundle_name}"
119+
120+
# Install bundle to lib directory
121+
sudo mkdir -p "${AWF_LIB_DIR}"
122+
sudo cp "${TEMP_DIR}/${bundle_name}" "${AWF_LIB_DIR}/${bundle_name}"
123+
124+
# Create wrapper script
125+
sudo tee "${AWF_INSTALL_DIR}/${AWF_INSTALL_NAME}" > /dev/null <<'WRAPPER'
126+
#!/bin/bash
127+
exec node /usr/local/lib/awf/awf-bundle.js "$@"
128+
WRAPPER
129+
sudo chmod +x "${AWF_INSTALL_DIR}/${AWF_INSTALL_NAME}"
130+
131+
echo "✓ Installed awf bundle to ${AWF_LIB_DIR}/${bundle_name}"
132+
}
133+
91134
install_linux_binary() {
92135
# Determine binary name based on architecture
93136
local awf_binary
@@ -134,18 +177,24 @@ install_darwin_binary() {
134177
sudo mv "${TEMP_DIR}/${awf_binary}" "${AWF_INSTALL_DIR}/${AWF_INSTALL_NAME}"
135178
}
136179

137-
case "$OS" in
138-
Linux)
139-
install_linux_binary
140-
;;
141-
Darwin)
142-
install_darwin_binary
143-
;;
144-
*)
145-
echo "ERROR: Unsupported operating system: ${OS}"
146-
exit 1
147-
;;
148-
esac
180+
# Try lightweight bundle first, fall back to platform binary
181+
if has_node_20; then
182+
install_bundle
183+
else
184+
echo "Node.js >= 20 not available, falling back to platform binary..."
185+
case "$OS" in
186+
Linux)
187+
install_linux_binary
188+
;;
189+
Darwin)
190+
install_darwin_binary
191+
;;
192+
*)
193+
echo "ERROR: Unsupported operating system: ${OS}"
194+
exit 1
195+
;;
196+
esac
197+
fi
149198

150199
# Verify installation
151200
which awf

pkg/constants/version_constants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const DefaultGeminiVersion Version = "latest"
4747
const DefaultGitHubMCPServerVersion Version = "v0.32.0"
4848

4949
// DefaultFirewallVersion is the default version of the gh-aw-firewall (AWF) binary
50-
const DefaultFirewallVersion Version = "v0.25.8"
50+
const DefaultFirewallVersion Version = "v0.25.10"
5151

5252
// AWFExcludeEnvMinVersion is the minimum AWF version that supports the --exclude-env flag.
5353
// Workflows pinning an older AWF version must not emit --exclude-env flags or the run will fail.

pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/basic-copilot.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
GH_AW_INFO_STAGED: "false"
5555
GH_AW_INFO_ALLOWED_DOMAINS: '["defaults"]'
5656
GH_AW_INFO_FIREWALL_ENABLED: "true"
57-
GH_AW_INFO_AWF_VERSION: "v0.25.8"
57+
GH_AW_INFO_AWF_VERSION: "v0.25.10"
5858
GH_AW_INFO_AWMG_VERSION: ""
5959
GH_AW_INFO_FIREWALL_TYPE: "squid"
6060
GH_AW_COMPILED_STRICT: "true"
@@ -277,7 +277,7 @@ jobs:
277277
- name: Install GitHub Copilot CLI
278278
run: ${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh latest
279279
- name: Install AWF binary
280-
run: bash ${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh v0.25.8
280+
run: bash ${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh v0.25.10
281281
- name: Determine automatic lockdown mode for GitHub MCP Server
282282
id: determine-automatic-lockdown
283283
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
@@ -289,7 +289,7 @@ jobs:
289289
const determineAutomaticLockdown = require('${{ runner.temp }}/gh-aw/actions/determine_automatic_lockdown.cjs');
290290
await determineAutomaticLockdown(github, context, core);
291291
- name: Download container images
292-
run: bash ${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh ghcr.io/github/gh-aw-firewall/agent:0.25.8 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.8 ghcr.io/github/gh-aw-firewall/squid:0.25.8 ghcr.io/github/gh-aw-mcpg:v0.2.11 ghcr.io/github/github-mcp-server:v0.32.0
292+
run: bash ${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh ghcr.io/github/gh-aw-firewall/agent:0.25.10 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.10 ghcr.io/github/gh-aw-firewall/squid:0.25.10 ghcr.io/github/gh-aw-mcpg:v0.2.11 ghcr.io/github/github-mcp-server:v0.32.0
293293
- name: Start MCP Gateway
294294
id: start-mcp-gateway
295295
env:
@@ -359,7 +359,7 @@ jobs:
359359
set -o pipefail
360360
touch /tmp/gh-aw/agent-step-summary.md
361361
# shellcheck disable=SC1003
362-
sudo -E awf --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --allow-domains api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --image-tag 0.25.8 --skip-pull --enable-api-proxy \
362+
sudo -E awf --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --allow-domains api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --image-tag 0.25.10 --skip-pull --enable-api-proxy \
363363
-- /bin/bash -c '/usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --allow-all-tools --allow-all-paths --add-dir "${GITHUB_WORKSPACE}" --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log
364364
env:
365365
COPILOT_AGENT_RUNNER_TYPE: STANDALONE

pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/with-imports.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
GH_AW_INFO_STAGED: "false"
5555
GH_AW_INFO_ALLOWED_DOMAINS: '["defaults"]'
5656
GH_AW_INFO_FIREWALL_ENABLED: "true"
57-
GH_AW_INFO_AWF_VERSION: "v0.25.8"
57+
GH_AW_INFO_AWF_VERSION: "v0.25.10"
5858
GH_AW_INFO_AWMG_VERSION: ""
5959
GH_AW_INFO_FIREWALL_TYPE: "squid"
6060
GH_AW_COMPILED_STRICT: "true"
@@ -278,7 +278,7 @@ jobs:
278278
- name: Install GitHub Copilot CLI
279279
run: ${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh latest
280280
- name: Install AWF binary
281-
run: bash ${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh v0.25.8
281+
run: bash ${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh v0.25.10
282282
- name: Determine automatic lockdown mode for GitHub MCP Server
283283
id: determine-automatic-lockdown
284284
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
@@ -290,7 +290,7 @@ jobs:
290290
const determineAutomaticLockdown = require('${{ runner.temp }}/gh-aw/actions/determine_automatic_lockdown.cjs');
291291
await determineAutomaticLockdown(github, context, core);
292292
- name: Download container images
293-
run: bash ${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh ghcr.io/github/gh-aw-firewall/agent:0.25.8 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.8 ghcr.io/github/gh-aw-firewall/squid:0.25.8 ghcr.io/github/gh-aw-mcpg:v0.2.11 ghcr.io/github/github-mcp-server:v0.32.0
293+
run: bash ${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh ghcr.io/github/gh-aw-firewall/agent:0.25.10 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.10 ghcr.io/github/gh-aw-firewall/squid:0.25.10 ghcr.io/github/gh-aw-mcpg:v0.2.11 ghcr.io/github/github-mcp-server:v0.32.0
294294
- name: Start MCP Gateway
295295
id: start-mcp-gateway
296296
env:
@@ -360,7 +360,7 @@ jobs:
360360
set -o pipefail
361361
touch /tmp/gh-aw/agent-step-summary.md
362362
# shellcheck disable=SC1003
363-
sudo -E awf --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --allow-domains api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --image-tag 0.25.8 --skip-pull --enable-api-proxy \
363+
sudo -E awf --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --allow-domains api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --image-tag 0.25.10 --skip-pull --enable-api-proxy \
364364
-- /bin/bash -c '/usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --allow-all-tools --allow-all-paths --add-dir "${GITHUB_WORKSPACE}" --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log
365365
env:
366366
COPILOT_AGENT_RUNNER_TYPE: STANDALONE

0 commit comments

Comments
 (0)