GitHub environment setting for all Jobs.
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" })
);
}
);
We have a concept for this, called jobSettings, which can be set at the GitHubWorkflow level. However, it does not include environment right now (but it should!). I'm going to mark this issue as a feature request for adding that property to jobSettings.
Hopefully this is something you'd be willing to contribute @gbvanrenswoude, and if so, keep in #518 might change the type for environment a bit.