Skip to content

Commit 66bfd7a

Browse files
committed
*: normalize file paths in all cases
1 parent 3bde8b2 commit 66bfd7a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/context.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ export function getDockerfilePath(inputs: Inputs): string | null {
108108

109109
if (inputs.file) {
110110
// If context is git context, just use the file path directly
111-
dockerfilePath = context === Context.gitContext() ? inputs.file : joinNonOverlapping(context, inputs.file);
111+
dockerfilePath = context === Context.gitContext() ? path.normalize(inputs.file) : joinNonOverlapping(context, inputs.file);
112112
} else if (inputs['dockerfile']) {
113113
// If context is git context, just use the dockerfile path directly
114-
dockerfilePath = context === Context.gitContext() ? inputs['dockerfile'] : joinNonOverlapping(context, inputs['dockerfile']);
114+
dockerfilePath = context === Context.gitContext() ? path.normalize(inputs['dockerfile']) : joinNonOverlapping(context, inputs['dockerfile']);
115115
} else {
116116
// If context is git context, just use 'Dockerfile'
117117
dockerfilePath = context === Context.gitContext() ? 'Dockerfile' : joinNonOverlapping(context, 'Dockerfile');
@@ -126,7 +126,7 @@ export function getDockerfilePath(inputs: Inputs): string | null {
126126
}
127127
return dockerfilePath;
128128
} catch (statError) {
129-
core.warning(`Dockerfile not found at path: ${dockerfilePath}`);
129+
core.warning(`Dockerfile not found at path: ${dockerfilePath}; error: ${statError?.message}`);
130130
return null;
131131
}
132132
} catch (error) {

0 commit comments

Comments
 (0)