From 1531f42ca036b22af06569346be1a2886edc610a Mon Sep 17 00:00:00 2001 From: UnstoppableMango Date: Mon, 1 Jun 2026 17:21:17 -0500 Subject: [PATCH 1/2] Configure dependabot vulnerability alerts on all repos --- components/privateRepo.ts | 3 ++- components/publicRepo.ts | 3 ++- components/repo.ts | 5 +++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/components/privateRepo.ts b/components/privateRepo.ts index 26a488e..a547615 100644 --- a/components/privateRepo.ts +++ b/components/privateRepo.ts @@ -16,7 +16,8 @@ export class PrivateRepo extends Repo { }, opts); const repo = this.repo; + const vulnerabilityAlerts = this.vulnerabilityAlerts; - this.registerOutputs({ repo }); + this.registerOutputs({ repo, vulnerabilityAlerts }); } } diff --git a/components/publicRepo.ts b/components/publicRepo.ts index 4e78de5..2495242 100644 --- a/components/publicRepo.ts +++ b/components/publicRepo.ts @@ -39,7 +39,6 @@ export class PublicRepo extends Repo { visibility: 'public', allowAutoMerge: true, template: args.template, - vulnerabilityAlerts: true, pages: args.pages, topics: args.topics, }, @@ -48,6 +47,7 @@ export class PublicRepo extends Repo { ); const repo = this.repo; + const vulnerabilityAlerts = this.vulnerabilityAlerts; const statusChecks = args.githubChecks ? getGitHubStatusChecks(args.githubChecks) : getRequiredStatusChecks(args.requiredChecks); @@ -85,6 +85,7 @@ export class PublicRepo extends Repo { this.registerOutputs({ repo, mainRuleset, + vulnerabilityAlerts, }); } } diff --git a/components/repo.ts b/components/repo.ts index 4bfa505..d1f27c3 100644 --- a/components/repo.ts +++ b/components/repo.ts @@ -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); @@ -30,5 +31,9 @@ export abstract class Repo extends ComponentResource { }, { parent: this }); this.repo = repo; + + this.vulnerabilityAlerts = new gh.RepositoryVulnerabilityAlerts(name, { + repository: repo.name, + }, { parent: this }); } } From 345f666d02890fde27ce614967538767a481b355 Mon Sep 17 00:00:00 2001 From: UnstoppableMango Date: Mon, 1 Jun 2026 17:28:52 -0500 Subject: [PATCH 2/2] Proper short-circuiting on refresh --- components/privateRepo.ts | 2 ++ components/publicRepo.ts | 4 +++- components/repo.ts | 7 ++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/components/privateRepo.ts b/components/privateRepo.ts index a547615..d4efcfa 100644 --- a/components/privateRepo.ts +++ b/components/privateRepo.ts @@ -15,6 +15,8 @@ export class PrivateRepo extends Repo { }, }, opts); + if (opts?.urn) return; // Refreshing + const repo = this.repo; const vulnerabilityAlerts = this.vulnerabilityAlerts; diff --git a/components/publicRepo.ts b/components/publicRepo.ts index 2495242..d5216b4 100644 --- a/components/publicRepo.ts +++ b/components/publicRepo.ts @@ -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, @@ -46,6 +46,8 @@ export class PublicRepo extends Repo { opts, ); + if (opts?.urn) return; // Refreshing + const repo = this.repo; const vulnerabilityAlerts = this.vulnerabilityAlerts; const statusChecks = args.githubChecks diff --git a/components/repo.ts b/components/repo.ts index d1f27c3..fc27002 100644 --- a/components/repo.ts +++ b/components/repo.ts @@ -30,10 +30,11 @@ export abstract class Repo extends ComponentResource { ...args.overrides, }, { parent: this }); - this.repo = repo; - - this.vulnerabilityAlerts = new gh.RepositoryVulnerabilityAlerts(name, { + const vulnerabilityAlerts = new gh.RepositoryVulnerabilityAlerts(name, { repository: repo.name, }, { parent: this }); + + this.repo = repo; + this.vulnerabilityAlerts = vulnerabilityAlerts; } }