Skip to content

Commit 2b36d2c

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

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
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 & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -108,27 +108,15 @@ 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');
118118
}
119-
120-
// Verify the file exists
121-
try {
122-
const stats = fs.statSync(dockerfilePath);
123-
if (!stats.isFile()) {
124-
core.warning(`Path exists but is not a file: ${dockerfilePath}`);
125-
return null;
126-
}
127-
return dockerfilePath;
128-
} catch (statError) {
129-
core.warning(`Dockerfile not found at path: ${dockerfilePath}`);
130-
return null;
131-
}
119+
return dockerfilePath;
132120
} catch (error) {
133121
core.warning(`Error getting dockerfile path: ${(error as Error).message}`);
134122
return null;

0 commit comments

Comments
 (0)