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

GitHub environment setting for all Jobs.

Open gbvanrenswoude opened this issue 2 years ago • 1 comments

We need to specify the environment: tst job property everywhere that needs AWS logging in because of a condition on the thrust policy of the AWS IAM role. I can only add it tho using pipeline.addStageWithGitHubOptions and this adds it to the deployment, but not the uploading of the assets. I also can't seem to figure out how to JsonPatch the environment: tst in under each individual jobs, since it does not support wildcards.

How can I set a GitHub environment for the synth and asset part of the pipeline?

We worked around this for now doing:

["Assets-FileAsset1", "Assets-FileAsset2", "Assets-FileAsset3"].forEach(
  (jobName) => {
    workflow.patch(
      JsonPatch.add(`/jobs/${jobName}`, { environment: "tst" })
    );
  }
);

gbvanrenswoude avatar Feb 20 '23 14:02 gbvanrenswoude