Skip to content

Commit

Permalink
fix: cdk synth creates incorrect file paths on Windows (#880)
Browse files Browse the repository at this point in the history
Fixes #877

The complaint is that we are created file paths like `./cdk.out/assembly-OnstageCms\publish-Assets-FileAsset5-step.sh`. This is due to `path.join` defaulting to the system's separator (on windows, `\`). But GitHub actions use the posix version `/`. Instead, we should be using `path.posix.join`.
  • Loading branch information
kaizencc authored Feb 14, 2024
1 parent 051d4a6 commit 178c4a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ export class GitHubWorkflow extends PipelineBase {
this.assetHashMap[assetId] = jobId;
fileContents.push(`echo '${ASSET_HASH_NAME}=${assetId}' >> $GITHUB_OUTPUT`);

const publishStepFile = path.join(path.dirname(relativeToAssembly(assetManifestPath)), `publish-${jobId}-step.sh`);
const publishStepFile = path.posix.join(path.dirname(relativeToAssembly(assetManifestPath)), `publish-${jobId}-step.sh`);
mkdirSync(path.dirname(publishStepFile), { recursive: true });
writeFileSync(publishStepFile, fileContents.join('\n'), { encoding: 'utf-8' });

Expand Down

0 comments on commit 178c4a6

Please sign in to comment.