Skip to content

Commit

Permalink
fix(cdk-diff): should work with pnpm [CLK-252116] (#266)
Browse files Browse the repository at this point in the history
* fix: cdk-diff should work with pnpm [CLK-252116]

* chore: self mutation

Signed-off-by: github-actions <[email protected]>

---------

Signed-off-by: github-actions <[email protected]>
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
ahammond and github-actions authored May 11, 2024
1 parent 37283c3 commit bd54d45
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
14 changes: 14 additions & 0 deletions API.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 21 additions & 3 deletions src/cdk-diff-workflow.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { SampleFile, YamlFile } from 'projen';
import { SampleFile, YamlFile, javascript } from 'projen';
import { NodePackage } from 'projen/lib/javascript';
import { clickupCdk } from './clickup-cdk';
import { OptionalNodeVersion } from './optional-node-version';
import { parameters } from './utils/parameters';

export module cdkDiffWorkflow {
function createCdkDiffWorkflow(options: CDKDiffOptionsConfig) {
const installDeps =
options.packageManager === javascript.NodePackageManager.PNPM
? 'pnpm i --frozen-lockfile'
: 'yarn install --check-files';

const defaultWorkflow = {
name: 'cdk-diff',
on: {
Expand Down Expand Up @@ -51,7 +56,7 @@ export module cdkDiffWorkflow {
},
{
name: 'Install dependencies',
run: 'yarn install --check-files',
run: installDeps,
},
createStackCaptureStep(options.envsToDiff),
...createDiffSteps(options.envsToDiff).flat(),
Expand Down Expand Up @@ -283,6 +288,12 @@ export module cdkDiffWorkflow {
* Detrmines if the OIDC role stack should be created
*/
readonly createOidcRoleStack?: boolean;

/**
* Which package manager is being used?
* @default - the packageManager in the project
*/
readonly packageManager?: javascript.NodePackageManager;
}

export function getCDKDiffOptions(options?: CDKDiffOptionsConfig) {
Expand All @@ -295,7 +306,14 @@ export module cdkDiffWorkflow {
override?: any,
): void {
new YamlFile(project, '.github/workflows/cdk-diff.yml', {
obj: { ...createCdkDiffWorkflow({ nodeVersion: project.workflowNodeVersion, ...options }), ...override },
obj: {
...createCdkDiffWorkflow({
nodeVersion: project.workflowNodeVersion,
packageManager: project.package.packageManager,
...options,
}),
...override,
},
});
}

Expand Down

0 comments on commit bd54d45

Please sign in to comment.