Skip to content

Commit b894585

Browse files
authored
Add AppInsights connection string injection to VS Code extension release workflow (#241)
1 parent d7a2d3d commit b894585

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/release-vscode-extension.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,22 @@ jobs:
7575
cd vscode-extension
7676
npm install
7777
78+
- name: Inject Application Insights Connection String
79+
run: |
80+
$telemetryFile = "src/ExcelMcp.McpServer/Telemetry/ExcelMcpTelemetry.cs"
81+
$connectionString = "${{ secrets.APPINSIGHTS_CONNECTION_STRING }}"
82+
83+
if ([string]::IsNullOrWhiteSpace($connectionString)) {
84+
Write-Output "⚠️ APPINSIGHTS_CONNECTION_STRING secret not configured - telemetry will be disabled"
85+
} else {
86+
Write-Output "Injecting Application Insights connection string..."
87+
$content = Get-Content $telemetryFile -Raw
88+
$content = $content -replace '__APPINSIGHTS_CONNECTION_STRING__', $connectionString
89+
Set-Content $telemetryFile $content
90+
Write-Output "✅ Telemetry connection string injected"
91+
}
92+
shell: pwsh
93+
7894
- name: Build and Package Extension
7995
run: |
8096
cd vscode-extension

0 commit comments

Comments
 (0)