Skip to content

Commit 5660ad7

Browse files
authored
Fix shellcheck violations in safe-inputs server startup script (#6086)
1 parent 4a21f24 commit 5660ad7

4 files changed

Lines changed: 45 additions & 30 deletions

File tree

.changeset/patch-fix-shellcheck-safe-inputs-startup.md

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/daily-performance-summary.lock.yml

Lines changed: 12 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/test-python-safe-input.lock.yml

Lines changed: 12 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/workflow/sh/start_safe_inputs_server.sh

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ echo " Working directory: $(pwd)"
2424
mkdir -p /tmp/gh-aw/safe-inputs/logs
2525

2626
# Create initial server.log file for artifact upload
27-
echo "Safe Inputs MCP Server Log" > /tmp/gh-aw/safe-inputs/logs/server.log
28-
echo "Start time: $(date)" >> /tmp/gh-aw/safe-inputs/logs/server.log
29-
echo "===========================================" >> /tmp/gh-aw/safe-inputs/logs/server.log
30-
echo "" >> /tmp/gh-aw/safe-inputs/logs/server.log
27+
{
28+
echo "Safe Inputs MCP Server Log"
29+
echo "Start time: $(date)"
30+
echo "==========================================="
31+
echo ""
32+
} > /tmp/gh-aw/safe-inputs/logs/server.log
3133

3234
# Start the HTTP server in the background
3335
echo "Starting safe-inputs MCP HTTP server..."
@@ -47,18 +49,18 @@ for i in {1..10}; do
4749
fi
4850

4951
# Check if server is responding
50-
if curl -s -f http://localhost:$GH_AW_SAFE_INPUTS_PORT/health > /dev/null 2>&1; then
52+
if curl -s -f "http://localhost:$GH_AW_SAFE_INPUTS_PORT/health" > /dev/null 2>&1; then
5153
echo "Safe Inputs MCP server is ready (attempt $i/10)"
5254
break
5355
fi
5456

55-
if [ $i -eq 10 ]; then
57+
if [ "$i" -eq 10 ]; then
5658
echo "ERROR: Safe Inputs MCP server failed to start after 10 seconds"
57-
echo "Process status: $(ps aux | grep '[m]cp-server.cjs' || echo 'not running')"
59+
echo "Process status: $(pgrep -f 'mcp-server.cjs' || echo 'not running')"
5860
echo "Server log contents:"
5961
cat /tmp/gh-aw/safe-inputs/logs/server.log
6062
echo "Checking port availability:"
61-
netstat -tuln | grep $GH_AW_SAFE_INPUTS_PORT || echo "Port $GH_AW_SAFE_INPUTS_PORT not listening"
63+
netstat -tuln | grep "$GH_AW_SAFE_INPUTS_PORT" || echo "Port $GH_AW_SAFE_INPUTS_PORT not listening"
6264
exit 1
6365
fi
6466

@@ -67,5 +69,5 @@ for i in {1..10}; do
6769
done
6870

6971
# Output the configuration for the MCP client
70-
echo "port=$GH_AW_SAFE_INPUTS_PORT" >> $GITHUB_OUTPUT
71-
echo "api_key=$GH_AW_SAFE_INPUTS_API_KEY" >> $GITHUB_OUTPUT
72+
echo "port=$GH_AW_SAFE_INPUTS_PORT" >> "$GITHUB_OUTPUT"
73+
echo "api_key=$GH_AW_SAFE_INPUTS_API_KEY" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)