@bifravst/ci
Version:
Sets up the permissions in our CI account for all repositories in this account to be able to use it for CI runs.
19 lines (18 loc) • 797 B
JavaScript
import { CfnOutput, Stack } from 'aws-cdk-lib';
import { RepoPermission } from './RepoPermission.js';
export class CIStack extends Stack {
constructor(parent, name, { repos, gitHubOICDProviderArn, }) {
super(parent, name);
for (const { id, owner, name: repo } of repos) {
const perm = new RepoPermission(this, repo, {
repository: { id, owner, name: repo },
gitHubOICDProviderArn,
});
new CfnOutput(this, `${id}:ciRoleArn`, {
exportName: `${name}:${id}:ciRoleArn`,
description: `Role ARN to use for running continuous integration tests using GitHub Actions in the repository ${owner}/${repo} (${id})`,
value: perm.role.roleArn,
});
}
}
}