diff --git a/.github/uitest/action.yml b/.github/uitest/action.yml
index bbd0d05023..4cc0217567 100644
--- a/.github/uitest/action.yml
+++ b/.github/uitest/action.yml
@@ -37,6 +37,7 @@ runs:
shell: bash
env:
DOTVVM_SAMPLES_CONFIG_PROFILE: ${{ inputs.samples-config }}
+ GITHUB_TOKEN: ${{ inputs.github-token }}
- if: ${{ runner.os == 'Windows' }}
run: choco install dotnet-aspnetcoremodule-v2 -y
@@ -53,6 +54,7 @@ runs:
shell: pwsh
env:
DOTVVM_SAMPLES_CONFIG_PROFILE: ${{ inputs.samples-config }}
+ GITHUB_TOKEN: ${{ inputs.github-token }}
# publish the result to github
- uses: ./.github/test-report
diff --git a/.github/uitest/uitest.ps1 b/.github/uitest/uitest.ps1
index 3a1b990223..579c4b8e62 100644
--- a/.github/uitest/uitest.ps1
+++ b/.github/uitest/uitest.ps1
@@ -110,6 +110,8 @@ function Start-Sample {
[int][parameter(Position = 2)]$port
)
Invoke-RequiredCmds "Start sample '$sampleName'" {
+ Reset-IISServerManager -Confirm:$false
+
Remove-IISSite -Confirm:$false -Name $sampleName -ErrorAction SilentlyContinue
icacls "$root\artifacts\" /grant "IIS_IUSRS:(OI)(CI)F"
@@ -117,7 +119,7 @@ function Start-Sample {
New-IISSite -Name "$sampleName" `
-PhysicalPath "$path" `
-BindingInformation "*:${port}:"
-
+
# ensure IIS created the site
while ($true) {
$state = (Get-IISSite -Name $sampleName).State
@@ -131,6 +133,15 @@ function Start-Sample {
throw "Site '${sampleName}' could not be started. State: '${state}'."
}
}
+
+ # add or update environment variable to the application pool
+ $existingEnvVar = c:\windows\system32\inetsrv\appcmd.exe list config -section:system.applicationHost/applicationPools `
+ | out-string `
+ | select-xml -XPath "//add[@name='DefaultAppPool']/environmentVariables/add[@name='GITHUB_TOKEN']"
+ if ($existingEnvVar -ne $null) {
+ c:\windows\system32\inetsrv\appcmd.exe set config -section:system.applicationHost/applicationPools /-"[name='DefaultAppPool'].environmentVariables.[name='GITHUB_TOKEN']" /commit:apphost
+ }
+ c:\windows\system32\inetsrv\appcmd.exe set config -section:system.applicationHost/applicationPools /+"[name='DefaultAppPool'].environmentVariables.[name='GITHUB_TOKEN',value='$env:GITHUB_TOKEN']" /commit:apphost
}
}
diff --git a/src/Samples/Owin/DotVVM.Samples.BasicSamples.Owin.csproj b/src/Samples/Owin/DotVVM.Samples.BasicSamples.Owin.csproj
index 1b85ac7325..7a1472bcfa 100644
--- a/src/Samples/Owin/DotVVM.Samples.BasicSamples.Owin.csproj
+++ b/src/Samples/Owin/DotVVM.Samples.BasicSamples.Owin.csproj
@@ -39,5 +39,6 @@
+
diff --git a/src/Samples/Owin/Properties/launchSettings.json b/src/Samples/Owin/Properties/launchSettings.json
index 00ab196b05..5083b9d1b0 100644
--- a/src/Samples/Owin/Properties/launchSettings.json
+++ b/src/Samples/Owin/Properties/launchSettings.json
@@ -3,8 +3,8 @@
"DotVVM.Samples.BasicSamples.Owin": {
"commandName": "Project",
"launchBrowser": true,
- "launchUrl": "http://localhost:5407",
- "applicationUrl": "http://localhost:5407",
+ "launchUrl": "http://localhost:65481/",
+ "applicationUrl": "http://localhost:65481/",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
diff --git a/src/Samples/Owin/Web.config b/src/Samples/Owin/Web.config
index b5f4f6e328..e7ffd97b9e 100644
--- a/src/Samples/Owin/Web.config
+++ b/src/Samples/Owin/Web.config
@@ -25,13 +25,13 @@
-
+
-
+
@@ -49,9 +49,21 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file