cdk-pipelines-github icon indicating copy to clipboard operation
cdk-pipelines-github copied to clipboard

diffProtection can't be disabled with `--context` option

Open christophgysin opened this issue 1 year ago • 0 comments

AFAIK it is not possible to pass typed context values using --context. See also https://github.com/aws/aws-cdk/issues/2204.

This makes it impossible to get past the check at https://github.com/cdklabs/cdk-pipelines-github/blob/main/src/pipeline.ts#L300-L301:

    const diffProtection = this.node.tryGetContext('cdk-pipelines-github:diffProtection') ?? true;
    if (diffProtection && process.env.GITHUB_WORKFLOW === this.workflowName) {

I suggest to also allow string values ("false") to disable the check.

christophgysin avatar Oct 17 '22 15:10 christophgysin