Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
set +o histexpand
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Good practice adding set +o histexpand right after the shebang line. This disables Bash history expansion globally for the script, preventing unexpected ! expansion issues. Consider adding a brief inline comment explaining why this is needed for maintainability.



# install project dependencies
make deps
Expand Down
2 changes: 2 additions & 0 deletions actions/setup-cli/install.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions actions/setup-cli/install_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
set +o histexpand

# Test script for install.sh in setup-cli action
set -e

Expand Down
2 changes: 2 additions & 0 deletions actions/setup/clean.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Clean Action Post Script
# Mirror of actions/setup/post.js for script mode (run: bash steps).
# Sends an OTLP conclusion span then removes the /tmp/gh-aw/ directory.
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/js/mount_mcp_as_cli.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ function generateCLIWrapperScript(serverName, serverUrl, toolsFile, apiKey, brid
const safeBridge = shellEscapeDoubleQuoted(bridgeScript);

return `#!/usr/bin/env bash
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Excellent — adding set +o histexpand to the generated MCP CLI wrapper script template ensures history expansion is disabled in auto-generated scripts too. This is particularly important since these scripts are auto-generated and could contain user-supplied content with ! characters.

set +o histexpand

# MCP CLI wrapper for: ${safeName}
# Auto-generated by gh-aw. Do not modify.
#
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/setup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Setup Action
# Copies activation job files to the agent environment
#
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/append_agent_step_summary.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Append the agent's step summary to the real $GITHUB_STEP_SUMMARY.
# The file was written by the agent and already redacted for secrets.
# This is a no-op when the file is empty (agent wrote nothing).
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/check_mcp_servers.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Check MCP Server Functionality
# This script performs basic functionality checks on MCP servers configured by the MCP gateway
# It sends an MCP ping + initialize + tools/list request to each server to verify backend connectivity
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/check_mcp_servers_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
set +o histexpand

# Test script for check_mcp_servers.sh
set -e

Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/clean_git_credentials.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

#
# clean_git_credentials.sh - Remove git credentials from all git checkouts
#
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/clean_git_credentials_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Test script for clean_git_credentials.sh
# Run: bash clean_git_credentials_test.sh

Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/clone_repo_memory_branch.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Clone repo-memory branch script
# Clones a repo-memory branch or creates an orphan branch if it doesn't exist
#
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/commit_cache_memory_git.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
set +o histexpand

# commit_cache_memory_git.sh
# Post-agent git commit for integrity-aware cache-memory.
#
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/compute_artifact_prefix.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

#
# compute_artifact_prefix.sh - Compute a stable artifact name prefix for workflow_call runs
#
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/configure_gh_for_ghe.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Configure gh CLI for GitHub Enterprise
#
# This script configures the gh CLI to work with GitHub Enterprise environments
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/configure_gh_for_ghe_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Test script for configure_gh_for_ghe.sh

set -e
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/convert_gateway_config_claude.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Convert MCP Gateway Configuration to Claude Format
# This script converts the gateway's standard HTTP-based MCP configuration
# to the JSON format expected by Claude (without Copilot-specific fields)
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/convert_gateway_config_codex.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Convert MCP Gateway Configuration to Codex Format
# This script converts the gateway's standard HTTP-based MCP configuration
# to the TOML format expected by Codex
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/convert_gateway_config_codex_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Test script for convert_gateway_config_codex.sh

set -e
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/convert_gateway_config_copilot.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Convert MCP Gateway Configuration to Copilot Format
# This script converts the gateway's standard HTTP-based MCP configuration
# to the format expected by GitHub Copilot CLI
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/convert_gateway_config_crush.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Convert MCP Gateway Configuration to Crush Format
# This script converts the gateway's standard HTTP-based MCP configuration
# to the JSON format expected by Crush (.crush.json)
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/convert_gateway_config_gemini.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Convert MCP Gateway Configuration to Gemini Format
# This script converts the gateway's standard HTTP-based MCP configuration
# to the JSON format expected by Gemini CLI (.gemini/settings.json)
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/copy_copilot_session_state.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Copy the entire Copilot session-state directory to the agent logs folder
# for artifact collection. This ensures all session files (events.jsonl,
# session.db, plan.md, checkpoints, etc.) are in /tmp/gh-aw/ where secret
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/download_docker_images.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Download Docker images with retry logic and controlled parallelism
# Usage: download_docker_images.sh IMAGE1 [IMAGE2 ...]
#
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/download_docker_images_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Test script for download_docker_images.sh
# Tests concurrent download functionality

Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/install_awf_binary.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Install AWF (Agentic Workflow Firewall) with SHA256 checksum verification
# Usage: install_awf_binary.sh VERSION
#
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/install_copilot_cli.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Install GitHub Copilot CLI with SHA256 checksum verification
# Usage: install_copilot_cli.sh [VERSION]
#
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/install_docker_macos.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Install Docker on macOS GitHub Actions runners via colima
# Usage: install_docker_macos.sh
#
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/install_gh_cli.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Install GitHub CLI (gh) if not already present
#
# This script installs the GitHub CLI using the official apt repository on
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/parse_guard_list.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
set +o histexpand

set -eo pipefail

# parse_guard_list.sh - Parse comma/newline-separated guard policy lists into JSON arrays
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/restore_base_github_folders.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

#
# restore_base_github_folders.sh - Restore agent config folders/files from the base
# branch snapshot after PR checkout
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/restore_base_github_folders_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Tests for restore_base_github_folders.sh
# Run: bash restore_base_github_folders_test.sh

Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/sanitize_path.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

Comment on lines 1 to +3
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sanitize_path.sh is explicitly intended to be sourced; unconditionally running set +o histexpand will permanently change the caller’s shell option state. Consider capturing whether history expansion was enabled (e.g., via $- containing H), disabling it for the script body, then restoring it before returning so sourcing doesn’t leave the user’s shell modified beyond PATH.

Copilot uses AI. Check for mistakes.
# Sanitize PATH by removing empty elements, leading/trailing colons
# Usage: source sanitize_path.sh <raw_path>
# or: . sanitize_path.sh <raw_path>
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/sanitize_path_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Tests for sanitize_path.sh
# Run: bash sanitize_path_test.sh

Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/save_base_github_folders.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

#
# save_base_github_folders.sh - Snapshot agent config folders/files from the workspace
#
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/save_base_github_folders_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Tests for save_base_github_folders.sh
# Run: bash save_base_github_folders_test.sh

Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/setup_cache_memory_git.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
set +o histexpand

# setup_cache_memory_git.sh
# Pre-agent git setup for integrity-aware cache-memory.
#
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/setup_cache_memory_git_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Tests for setup_cache_memory_git.sh — pre-agent sanitization block
# Run: bash setup_cache_memory_git_test.sh

Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/start_cli_proxy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Start DIFC proxy on the host for AWF CLI proxy sidecar
# This script starts the awmg proxy container so AWF's cli-proxy container
# can connect to it via host.docker.internal:18443 for gh CLI access.
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/start_difc_proxy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Start DIFC proxy for pre-agent gh CLI steps
# This script starts the awmg proxy container that routes gh CLI calls
# through DIFC integrity filtering before the agent runs.
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/start_mcp_gateway.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Start MCP Gateway
# This script starts the MCP gateway process that proxies MCP servers through a unified HTTP endpoint
# Following the MCP Gateway Specification: https://github.com/github/gh-aw/blob/main/docs/src/content/docs/reference/mcp-gateway.md
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/start_mcp_gateway_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
set +o histexpand

# Test script for start_mcp_gateway.sh
set -e

Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/start_mcp_scripts_server.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Start MCP Scripts HTTP Server
# This script starts the mcp-scripts MCP server and waits for it to become ready

Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/start_safe_outputs_server.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Start Safe Outputs MCP HTTP Server
# This script starts the safe-outputs MCP server and waits for it to become ready

Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/stop_cli_proxy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Stop CLI proxy container after AWF execution
# This script removes the awmg-cli-proxy container started by start_cli_proxy.sh.

Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/stop_difc_proxy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Stop DIFC proxy for pre-agent gh CLI steps
# This script stops the awmg proxy container and removes the proxy CA certificate
# from the system trust store (if it was installed).
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/stop_mcp_gateway.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Stop MCP Gateway
# This script stops the MCP gateway process using the /close endpoint for graceful shutdown,
# falling back to kill signals if the endpoint is unavailable or fails.
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/validate_gatewayed_server.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
set +o histexpand

set -e

# validate_gatewayed_server.sh - Validate that an MCP server is correctly gatewayed
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/validate_gatewayed_server_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
set +o histexpand

# Test script for validate_gatewayed_server.sh
set -e

Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/validate_multi_secret.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
set +o histexpand

set -e

# validate_multi_secret.sh - Validate that at least one secret from a list is configured
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/validate_prompt_placeholders.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
set +o histexpand

# Validate that all expression placeholders have been properly substituted
# This script checks that the prompt file doesn't contain any unreplaced placeholders

Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/validate_prompt_placeholders_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
set +o histexpand

# Test script for validate_prompt_placeholders.sh

set -e
Expand Down
2 changes: 2 additions & 0 deletions actions/setup/sh/verify_mcp_gateway_health.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set +o histexpand

# Verify MCP Gateway Health
# This script verifies that the MCP gateway is running and healthy

Expand Down
2 changes: 2 additions & 0 deletions install-gh-aw.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
set +o histexpand


# Script to download and install gh-aw binary for the current OS and architecture
# Supports: Linux, macOS (Darwin), FreeBSD, Windows (Git Bash/MSYS/Cygwin)
Expand Down
2 changes: 2 additions & 0 deletions scripts/apply-astro-conversion.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
set +o histexpand

# Apply Astro to GFM conversion to all docs files
# Usage: ./scripts/apply-astro-conversion.sh

Expand Down
2 changes: 2 additions & 0 deletions scripts/build-release.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
set +o histexpand

# Custom build script for gh-extension-precompile to set version correctly
# This script is called during the release process to build binaries with proper version info
set -e
Expand Down
Loading
Loading