Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion components/privateRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ export class PrivateRepo extends Repo {
},
}, opts);

if (opts?.urn) return; // Refreshing

const repo = this.repo;
const vulnerabilityAlerts = this.vulnerabilityAlerts;

this.registerOutputs({ repo });
this.registerOutputs({ repo, vulnerabilityAlerts });
Comment thread
UnstoppableMango marked this conversation as resolved.
}
}
7 changes: 5 additions & 2 deletions components/publicRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface PublicRepoArgs {
}

export class PublicRepo extends Repo {
public readonly mainRuleset: gh.RepositoryRuleset;
public readonly mainRuleset!: gh.RepositoryRuleset;

constructor(
name: string,
Expand All @@ -39,15 +39,17 @@ export class PublicRepo extends Repo {
visibility: 'public',
allowAutoMerge: true,
template: args.template,
vulnerabilityAlerts: true,
pages: args.pages,
topics: args.topics,
},
},
opts,
);

if (opts?.urn) return; // Refreshing

const repo = this.repo;
const vulnerabilityAlerts = this.vulnerabilityAlerts;
const statusChecks = args.githubChecks
? getGitHubStatusChecks(args.githubChecks)
: getRequiredStatusChecks(args.requiredChecks);
Comment thread
UnstoppableMango marked this conversation as resolved.
Expand Down Expand Up @@ -85,6 +87,7 @@ export class PublicRepo extends Repo {
this.registerOutputs({
repo,
mainRuleset,
vulnerabilityAlerts,
});
}
}
Expand Down
6 changes: 6 additions & 0 deletions components/repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface RepoArgs {

export abstract class Repo extends ComponentResource {
public readonly repo!: gh.Repository;
public readonly vulnerabilityAlerts!: gh.RepositoryVulnerabilityAlerts;

constructor(type: string, name: string, args: RepoArgs, opts?: ComponentResourceOptions) {
super(type, name, args, opts);
Expand All @@ -29,6 +30,11 @@ export abstract class Repo extends ComponentResource {
...args.overrides,
}, { parent: this });

const vulnerabilityAlerts = new gh.RepositoryVulnerabilityAlerts(name, {
repository: repo.name,
}, { parent: this });

this.repo = repo;
this.vulnerabilityAlerts = vulnerabilityAlerts;
}
}
Loading