cdklabs / cdklabs/cdk-pipelines-github
Feature request: `fileAssetJobSettings` for file-asset publishing jobs
- Dominant language
- TypeScript
- Stars
- 384
- Forks
- 45
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 4
Description
`GitHubWorkflowProps` exposes `dockerAssetJobSettings` to inject `setupSteps` and extra `permissions` into Docker-asset publishing jobs, but there is no equivalent for **file-asset** publishing jobs (`Assets-FileAsset*`).
The [`npm install --no-save cdk-assets` step in `jobForAssetPublish()`](https://github.com/cdklabs/cdk-pipelines-github/blob/7c1ee2d26cdb173310c6d387e90f6775eedf1bba/src/pipeline.ts#L602-L605) is hardcoded, so there is no way to configure the npm registry, inject credentials, or add any pre-install step through the public API.
### Proposed API
```ts
export interface FileAssetJobSettings {
/** Steps to execute before installing cdk-assets and publishing. @default [] */
readonly setupSteps?: github.JobStep[];
/** Additional permissions for file-asset publishing jobs. @default - none */
readonly permissions?: github.JobPermissions;
}
export interface GitHubWorkflowProps extends PipelineBaseProps {
/** Job level settings applied to all file asset publishing jobs. @default - none */
readonly fileAssetJobSettings?: FileAssetJobSettings;
}
```
`setupSteps` would be injected immediately before the `Install` step in `jobForAssetPublish()`, consistent with how `dockerAssetJobSettings.setupSteps` is handled for Docker asset jobs.
### Use case
Any organisation that needs to configure npm before install - private registry, npm proxy, authentication - currently has no way to do so for file-asset jobs.
### Would you be willing to submit a PR?
Yes.
Contributor guide
Assessment
This issue has not been assessed yet.