Skip to content

Commit 513e079

Browse files
committed
fix pathing
1 parent 28c5b2c commit 513e079

File tree

1 file changed

+73
-11
lines changed

1 file changed

+73
-11
lines changed

.github/workflows/auto-update-Dockerfiles.yml

Lines changed: 73 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,69 @@ jobs:
2626
with:
2727
ref: 'dev'
2828

29+
# Debug environment before script execution
30+
- name: Debug Environment
31+
id: debug
32+
shell: pwsh
33+
run: |
34+
Write-Host "===== Current Working Directory ====="
35+
Write-Host "PWD: $PWD"
36+
Write-Host "GITHUB_WORKSPACE: $env:GITHUB_WORKSPACE"
37+
38+
Write-Host "===== Directory Contents ====="
39+
Get-ChildItem -Path $PWD | Format-Table Name, LastWriteTime, Length
40+
41+
Write-Host "===== Script File Check ====="
42+
$scriptPath1 = "$PWD/LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1"
43+
$scriptPath2 = "$PWD\LambdaRuntimeDockerfiles\get-latest-aspnet-versions.ps1"
44+
$scriptPath3 = "LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1"
45+
$scriptPath4 = ".\LambdaRuntimeDockerfiles\get-latest-aspnet-versions.ps1"
46+
47+
Write-Host "Script path 1 exists (forward slash): $(Test-Path $scriptPath1)"
48+
Write-Host "Script path 2 exists (backslash): $(Test-Path $scriptPath2)"
49+
Write-Host "Script path 3 exists (relative forward slash): $(Test-Path $scriptPath3)"
50+
Write-Host "Script path 4 exists (relative backslash): $(Test-Path $scriptPath4)"
51+
52+
if (Test-Path $scriptPath2) {
53+
Write-Host "Script content preview:"
54+
Get-Content -Path $scriptPath2 -TotalCount 10
55+
}
56+
57+
Write-Host "===== PowerShell Information ====="
58+
Write-Host "PowerShell Version: $($PSVersionTable.PSVersion)"
59+
Write-Host "PSModulePath: $env:PSModulePath"
60+
61+
Write-Host "===== update-dockerfile.ps1 Check ====="
62+
$updateScriptPath = ".\LambdaRuntimeDockerfiles\update-dockerfile.ps1"
63+
Write-Host "Update script exists: $(Test-Path $updateScriptPath)"
64+
65+
Write-Host "===== LambdaRuntimeDockerfiles Directory ====="
66+
if (Test-Path "LambdaRuntimeDockerfiles") {
67+
Get-ChildItem -Path "LambdaRuntimeDockerfiles" | Format-Table Name, LastWriteTime, Length
68+
}
69+
2970
# Determine the latest ASP.NET Core versions for all .NET versions
3071
- name: Determine Latest ASP.NET Core Versions
3172
id: get-versions
3273
shell: pwsh
3374
run: |
34-
$versions = .\LambdaRuntimeDockerfiles\get-latest-aspnet-versions.ps1
35-
foreach ($line in $versions) {
36-
if ($line -match '(.+)=(.+)') {
37-
echo "$($matches[1])=$($matches[2])" >> $env:GITHUB_OUTPUT
38-
echo "Using $($matches[1])=$($matches[2])"
75+
Write-Host "Attempting to execute script..."
76+
try {
77+
# Try different methods to execute the script
78+
Write-Host "Method 1: Using & with absolute path"
79+
$scriptPath = Join-Path $PWD "LambdaRuntimeDockerfiles/get-latest-aspnet-versions.ps1"
80+
$versions = & "$scriptPath"
81+
82+
foreach ($line in $versions) {
83+
if ($line -match '(.+)=(.+)') {
84+
echo "$($matches[1])=$($matches[2])" >> $env:GITHUB_OUTPUT
85+
echo "Using $($matches[1])=$($matches[2])"
86+
}
3987
}
88+
} catch {
89+
Write-Host "Error executing script: $_"
90+
Write-Host "Exiting with error"
91+
exit 1
4092
}
4193
4294
# Update .NET 8 AMD64 Dockerfile
@@ -48,7 +100,12 @@ jobs:
48100
NEXT_VERSION: ${{ steps.get-versions.outputs.NET_8_NEXT_VERSION }}
49101
run: |
50102
if (-not [string]::IsNullOrEmpty("${{ env.NEXT_VERSION }}")) {
51-
.\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
103+
Write-Host "Executing update-dockerfile.ps1 script with parameters:"
104+
Write-Host " DockerfilePath: ${{ env.DOCKERFILE_PATH }}"
105+
Write-Host " NextVersion: ${{ env.NEXT_VERSION }}"
106+
107+
$updateScriptPath = Join-Path $PWD "LambdaRuntimeDockerfiles/update-dockerfile.ps1"
108+
& "$updateScriptPath" -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
52109
} else {
53110
Write-Host "Skipping .NET 8 AMD64 update - No version detected"
54111
}
@@ -62,7 +119,8 @@ jobs:
62119
NEXT_VERSION: ${{ steps.get-versions.outputs.NET_8_NEXT_VERSION }}
63120
run: |
64121
if (-not [string]::IsNullOrEmpty("${{ env.NEXT_VERSION }}")) {
65-
.\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
122+
$updateScriptPath = Join-Path $PWD "LambdaRuntimeDockerfiles/update-dockerfile.ps1"
123+
& "$updateScriptPath" -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
66124
} else {
67125
Write-Host "Skipping .NET 8 ARM64 update - No version detected"
68126
}
@@ -76,7 +134,8 @@ jobs:
76134
NEXT_VERSION: ${{ steps.get-versions.outputs.NET_9_NEXT_VERSION }}
77135
run: |
78136
if (-not [string]::IsNullOrEmpty("${{ env.NEXT_VERSION }}")) {
79-
.\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
137+
$updateScriptPath = Join-Path $PWD "LambdaRuntimeDockerfiles/update-dockerfile.ps1"
138+
& "$updateScriptPath" -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
80139
} else {
81140
Write-Host "Skipping .NET 9 AMD64 update - No version detected"
82141
}
@@ -90,7 +149,8 @@ jobs:
90149
NEXT_VERSION: ${{ steps.get-versions.outputs.NET_9_NEXT_VERSION }}
91150
run: |
92151
if (-not [string]::IsNullOrEmpty("${{ env.NEXT_VERSION }}")) {
93-
.\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
152+
$updateScriptPath = Join-Path $PWD "LambdaRuntimeDockerfiles/update-dockerfile.ps1"
153+
& "$updateScriptPath" -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
94154
} else {
95155
Write-Host "Skipping .NET 9 ARM64 update - No version detected"
96156
}
@@ -104,7 +164,8 @@ jobs:
104164
NEXT_VERSION: ${{ steps.get-versions.outputs.NET_10_NEXT_VERSION }}
105165
run: |
106166
if (-not [string]::IsNullOrEmpty("${{ env.NEXT_VERSION }}")) {
107-
.\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
167+
$updateScriptPath = Join-Path $PWD "LambdaRuntimeDockerfiles/update-dockerfile.ps1"
168+
& "$updateScriptPath" -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
108169
} else {
109170
Write-Host "Skipping .NET 10 AMD64 update - No version detected"
110171
}
@@ -118,7 +179,8 @@ jobs:
118179
NEXT_VERSION: ${{ steps.get-versions.outputs.NET_10_NEXT_VERSION }}
119180
run: |
120181
if (-not [string]::IsNullOrEmpty("${{ env.NEXT_VERSION }}")) {
121-
.\LambdaRuntimeDockerfiles\update-dockerfile.ps1 -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
182+
$updateScriptPath = Join-Path $PWD "LambdaRuntimeDockerfiles/update-dockerfile.ps1"
183+
& "$updateScriptPath" -DockerfilePath "${{ env.DOCKERFILE_PATH }}" -NextVersion "${{ env.NEXT_VERSION }}"
122184
} else {
123185
Write-Host "Skipping .NET 10 ARM64 update - No version detected"
124186
}

0 commit comments

Comments
 (0)