From f35e3344d172e911a0918cfc40de0b3d0cfb9981 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Dec 2025 02:44:24 +0000 Subject: [PATCH 1/3] Initial plan From e02b04ac46f88d1d5fc268e4139684eac2934fc5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Dec 2025 02:56:20 +0000 Subject: [PATCH 2/3] Fix all shellcheck issues in safe-inputs server startup script - SC2086: Added double quotes around variables to prevent globbing - SC2129: Used compound redirection for multiple echo statements - SC2009: Replaced ps aux | grep with pgrep command Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .../daily-performance-summary.lock.yml | 22 ++++++++++--------- .../workflows/test-python-safe-input.lock.yml | 22 ++++++++++--------- pkg/workflow/sh/start_safe_inputs_server.sh | 22 ++++++++++--------- 3 files changed, 36 insertions(+), 30 deletions(-) diff --git a/.github/workflows/daily-performance-summary.lock.yml b/.github/workflows/daily-performance-summary.lock.yml index 9a8ea74c52c..13c6fb2e8e8 100644 --- a/.github/workflows/daily-performance-summary.lock.yml +++ b/.github/workflows/daily-performance-summary.lock.yml @@ -4371,10 +4371,12 @@ jobs: # Ensure logs directory exists mkdir -p /tmp/gh-aw/safe-inputs/logs # Create initial server.log file for artifact upload - echo "Safe Inputs MCP Server Log" > /tmp/gh-aw/safe-inputs/logs/server.log - echo "Start time: $(date)" >> /tmp/gh-aw/safe-inputs/logs/server.log - echo "===========================================" >> /tmp/gh-aw/safe-inputs/logs/server.log - echo "" >> /tmp/gh-aw/safe-inputs/logs/server.log + { + echo "Safe Inputs MCP Server Log" + echo "Start time: $(date)" + echo "===========================================" + echo "" + } > /tmp/gh-aw/safe-inputs/logs/server.log # Start the HTTP server in the background echo "Starting safe-inputs MCP HTTP server..." node mcp-server.cjs >> /tmp/gh-aw/safe-inputs/logs/server.log 2>&1 & @@ -4391,25 +4393,25 @@ jobs: exit 1 fi # Check if server is responding - if curl -s -f http://localhost:$GH_AW_SAFE_INPUTS_PORT/health > /dev/null 2>&1; then + if curl -s -f "http://localhost:$GH_AW_SAFE_INPUTS_PORT/health" > /dev/null 2>&1; then echo "Safe Inputs MCP server is ready (attempt $i/10)" break fi - if [ $i -eq 10 ]; then + if [ "$i" -eq 10 ]; then echo "ERROR: Safe Inputs MCP server failed to start after 10 seconds" - echo "Process status: $(ps aux | grep '[m]cp-server.cjs' || echo 'not running')" + echo "Process status: $(pgrep -f 'mcp-server.cjs' || echo 'not running')" echo "Server log contents:" cat /tmp/gh-aw/safe-inputs/logs/server.log echo "Checking port availability:" - netstat -tuln | grep $GH_AW_SAFE_INPUTS_PORT || echo "Port $GH_AW_SAFE_INPUTS_PORT not listening" + netstat -tuln | grep "$GH_AW_SAFE_INPUTS_PORT" || echo "Port $GH_AW_SAFE_INPUTS_PORT not listening" exit 1 fi echo "Waiting for server... (attempt $i/10)" sleep 1 done # Output the configuration for the MCP client - echo "port=$GH_AW_SAFE_INPUTS_PORT" >> $GITHUB_OUTPUT - echo "api_key=$GH_AW_SAFE_INPUTS_API_KEY" >> $GITHUB_OUTPUT + echo "port=$GH_AW_SAFE_INPUTS_PORT" >> "$GITHUB_OUTPUT" + echo "api_key=$GH_AW_SAFE_INPUTS_API_KEY" >> "$GITHUB_OUTPUT" - name: Setup MCPs env: diff --git a/.github/workflows/test-python-safe-input.lock.yml b/.github/workflows/test-python-safe-input.lock.yml index 6767705135b..7a98bfacde8 100644 --- a/.github/workflows/test-python-safe-input.lock.yml +++ b/.github/workflows/test-python-safe-input.lock.yml @@ -3346,10 +3346,12 @@ jobs: # Ensure logs directory exists mkdir -p /tmp/gh-aw/safe-inputs/logs # Create initial server.log file for artifact upload - echo "Safe Inputs MCP Server Log" > /tmp/gh-aw/safe-inputs/logs/server.log - echo "Start time: $(date)" >> /tmp/gh-aw/safe-inputs/logs/server.log - echo "===========================================" >> /tmp/gh-aw/safe-inputs/logs/server.log - echo "" >> /tmp/gh-aw/safe-inputs/logs/server.log + { + echo "Safe Inputs MCP Server Log" + echo "Start time: $(date)" + echo "===========================================" + echo "" + } > /tmp/gh-aw/safe-inputs/logs/server.log # Start the HTTP server in the background echo "Starting safe-inputs MCP HTTP server..." node mcp-server.cjs >> /tmp/gh-aw/safe-inputs/logs/server.log 2>&1 & @@ -3366,25 +3368,25 @@ jobs: exit 1 fi # Check if server is responding - if curl -s -f http://localhost:$GH_AW_SAFE_INPUTS_PORT/health > /dev/null 2>&1; then + if curl -s -f "http://localhost:$GH_AW_SAFE_INPUTS_PORT/health" > /dev/null 2>&1; then echo "Safe Inputs MCP server is ready (attempt $i/10)" break fi - if [ $i -eq 10 ]; then + if [ "$i" -eq 10 ]; then echo "ERROR: Safe Inputs MCP server failed to start after 10 seconds" - echo "Process status: $(ps aux | grep '[m]cp-server.cjs' || echo 'not running')" + echo "Process status: $(pgrep -f 'mcp-server.cjs' || echo 'not running')" echo "Server log contents:" cat /tmp/gh-aw/safe-inputs/logs/server.log echo "Checking port availability:" - netstat -tuln | grep $GH_AW_SAFE_INPUTS_PORT || echo "Port $GH_AW_SAFE_INPUTS_PORT not listening" + netstat -tuln | grep "$GH_AW_SAFE_INPUTS_PORT" || echo "Port $GH_AW_SAFE_INPUTS_PORT not listening" exit 1 fi echo "Waiting for server... (attempt $i/10)" sleep 1 done # Output the configuration for the MCP client - echo "port=$GH_AW_SAFE_INPUTS_PORT" >> $GITHUB_OUTPUT - echo "api_key=$GH_AW_SAFE_INPUTS_API_KEY" >> $GITHUB_OUTPUT + echo "port=$GH_AW_SAFE_INPUTS_PORT" >> "$GITHUB_OUTPUT" + echo "api_key=$GH_AW_SAFE_INPUTS_API_KEY" >> "$GITHUB_OUTPUT" - name: Setup MCPs env: diff --git a/pkg/workflow/sh/start_safe_inputs_server.sh b/pkg/workflow/sh/start_safe_inputs_server.sh index 147bda24265..74496d1fc5e 100644 --- a/pkg/workflow/sh/start_safe_inputs_server.sh +++ b/pkg/workflow/sh/start_safe_inputs_server.sh @@ -24,10 +24,12 @@ echo " Working directory: $(pwd)" mkdir -p /tmp/gh-aw/safe-inputs/logs # Create initial server.log file for artifact upload -echo "Safe Inputs MCP Server Log" > /tmp/gh-aw/safe-inputs/logs/server.log -echo "Start time: $(date)" >> /tmp/gh-aw/safe-inputs/logs/server.log -echo "===========================================" >> /tmp/gh-aw/safe-inputs/logs/server.log -echo "" >> /tmp/gh-aw/safe-inputs/logs/server.log +{ + echo "Safe Inputs MCP Server Log" + echo "Start time: $(date)" + echo "===========================================" + echo "" +} > /tmp/gh-aw/safe-inputs/logs/server.log # Start the HTTP server in the background echo "Starting safe-inputs MCP HTTP server..." @@ -47,18 +49,18 @@ for i in {1..10}; do fi # Check if server is responding - if curl -s -f http://localhost:$GH_AW_SAFE_INPUTS_PORT/health > /dev/null 2>&1; then + if curl -s -f "http://localhost:$GH_AW_SAFE_INPUTS_PORT/health" > /dev/null 2>&1; then echo "Safe Inputs MCP server is ready (attempt $i/10)" break fi - if [ $i -eq 10 ]; then + if [ "$i" -eq 10 ]; then echo "ERROR: Safe Inputs MCP server failed to start after 10 seconds" - echo "Process status: $(ps aux | grep '[m]cp-server.cjs' || echo 'not running')" + echo "Process status: $(pgrep -f 'mcp-server.cjs' || echo 'not running')" echo "Server log contents:" cat /tmp/gh-aw/safe-inputs/logs/server.log echo "Checking port availability:" - netstat -tuln | grep $GH_AW_SAFE_INPUTS_PORT || echo "Port $GH_AW_SAFE_INPUTS_PORT not listening" + netstat -tuln | grep "$GH_AW_SAFE_INPUTS_PORT" || echo "Port $GH_AW_SAFE_INPUTS_PORT not listening" exit 1 fi @@ -67,5 +69,5 @@ for i in {1..10}; do done # Output the configuration for the MCP client -echo "port=$GH_AW_SAFE_INPUTS_PORT" >> $GITHUB_OUTPUT -echo "api_key=$GH_AW_SAFE_INPUTS_API_KEY" >> $GITHUB_OUTPUT +echo "port=$GH_AW_SAFE_INPUTS_PORT" >> "$GITHUB_OUTPUT" +echo "api_key=$GH_AW_SAFE_INPUTS_API_KEY" >> "$GITHUB_OUTPUT" From d606ff6f991931d389a372d93b4265b2c7c7f226 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 11 Dec 2025 03:09:59 +0000 Subject: [PATCH 3/3] Add changeset: patch fix shellcheck safe inputs startup [skip-ci] --- .changeset/patch-fix-shellcheck-safe-inputs-startup.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .changeset/patch-fix-shellcheck-safe-inputs-startup.md diff --git a/.changeset/patch-fix-shellcheck-safe-inputs-startup.md b/.changeset/patch-fix-shellcheck-safe-inputs-startup.md new file mode 100644 index 00000000000..1c9fb7df116 --- /dev/null +++ b/.changeset/patch-fix-shellcheck-safe-inputs-startup.md @@ -0,0 +1,9 @@ +--- +"gh-aw": patch +--- + +Fix shellcheck violations in `pkg/workflow/sh/start_safe_inputs_server.sh` that caused +issues in compiled workflow lock files. Changes include quoting variables, using compound +redirection, and replacing `ps | grep` with `pgrep`. Recompiled workflows were updated +to propagate the fixes to lock files. +