Skip to content

Commit 17d0f15

Browse files
Merge pull request #18 from bfgroup/fix/d-drive-maping
Fix errors for current images without D drives.
2 parents cc9bc9e + c23c2cf commit 17d0f15

File tree

6 files changed

+16
-9
lines changed

6 files changed

+16
-9
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Test
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ main, 'fix/**' ]
66
paths-ignore:
77
- '**.md'
88
- '**.MD'
@@ -17,7 +17,7 @@ on:
1717

1818
jobs:
1919
test:
20-
runs-on: windows-2019
20+
runs-on: windows-2022
2121
name: Test
2222
env:
2323
TEST1: Test1
@@ -26,7 +26,7 @@ jobs:
2626
TEST_MAPPING_PATH: "C:\\map"
2727
strategy:
2828
matrix:
29-
docker_container: ["mcr.microsoft.com/windows/servercore:ltsc2019"]
29+
docker_container: ["mcr.microsoft.com/windows/servercore:ltsc2022"]
3030

3131
steps:
3232
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

action.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,15 @@ runs:
9393
shell: powershell
9494
- name: Run
9595
run: >-
96-
$eventPath = Split-Path -Path "${env:GITHUB_EVENT_PATH}" -Parent;
96+
$runnerPathSource = Split-Path -Path "${env:RUNNER_TEMP}" -Parent;
97+
$runnerPathTarget = $runnerPathSource.replace('D:', 'C:')
9798
9899
docker run
99100
${{ steps.settings.outputs.default_environment_variables }}
100101
${{ steps.settings.outputs.extra_args }}
101102
--rm
102103
--memory=${{ inputs.memory }}
103-
-v ${eventPath}:${eventPath}
104+
-v ${runnerPathSource}:${runnerPathTarget}
104105
-v ${{ steps.settings.outputs.workspace_path }}:${{ steps.settings.outputs.mapping_path }}
105106
-w ${{ steps.settings.outputs.work_path }}
106107
${{ inputs.image }}

src/parse_input_extra_args.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ $args_env = & "$splitToArgs" -argument_name "@--env" -env_arrays "$envNames";
1616
$args_entrypoint = & "$setOptionalVariable" -argument_name "@--entrypoint" -setVal "$entryPoint";
1717
$eargs = & "$trimArg" -arg "$extraArgs";
1818
$allargs = "@" + "${eargs}" + " " + "${args_env}" + " " + "${args_entrypoint}";
19-
& "$setoutputVariable" -name extra_args -val "$allargs";
19+
& "$setoutputVariable" -replace "" -name extra_args -val "$allargs";

src/parse_input_paths.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ $work_space_path = & "$getVariable" -defaultVal "$githubWorkSpace" -setVal "$wor
1414
$mapping_path = & "$getVariable" -defaultVal "$work_space_path" -setVal "$mappingPath";
1515
$work_path = & "$getVariable" -defaultVal "$mapping_path" -setVal "$workPath";
1616

17-
& "$setoutputVariable" -name workspace_path -val "$work_space_path";
17+
& "$setoutputVariable" -replace "" -name workspace_path -val "$work_space_path";
1818
& "$setoutputVariable" -name mapping_path -val "$mapping_path";
1919
& "$setoutputVariable" -name work_path -val "$work_path";

src/set_output_variable.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,26 @@
22
# set github output with name and value
33
param (
44
$name,
5-
$val = '@'
5+
$val = '@',
6+
$replace = 'D:',
7+
$with = 'C:'
68
)
79

810
$invovationPath = "$PSScriptRoot";
911
$trimArg = "$invovationPath" + "\trim_arg.ps1";
1012

1113
$trimmed_name = & $trimArg -arg $name;
1214
$trimmed_val = & $trimArg -arg $val;
15+
if ( $replace -ne "" ) {
16+
$trimmed_val = $trimmed_val.Replace( $replace, $with );
17+
}
1318

1419
function toGitHub {
1520
param(
1621
$output_name,
1722
$output_value
1823
)
24+
Write-Output "$output_name=$output_value"
1925
"$output_name=$output_value" >> $env:GITHUB_OUTPUT;
2026
}
2127

test/run_default.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Describe "run_default" {
1616

1717
Context "default GitHub Action paths should be available" {
1818
It "GITHUB_EVENT_PATH should exist" {
19-
"$env:GITHUB_EVENT_PATH" | Should -Exist
19+
"$env:GITHUB_EVENT_PATH".Replace('D:', 'C:') | Should -Exist
2020
}
2121
}
2222
}

0 commit comments

Comments
 (0)