Skip to content

Commit

Permalink
chore: enable Dependabot security updates (#342)
Browse files Browse the repository at this point in the history
There have been a bunch of security alerts on our prebuilt provider
repos recently due to dependencies like jsii and cross-spawn. These
could be easily addressed by Dependabot since all they need to update is
yarn.lock so they don't interfere with Projen. Enabling this will help
to get security alerts addressed faster than trying to go through
Projen.
  • Loading branch information
xiehan authored Dec 20, 2024
1 parent 91cacbe commit a860e4a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { DataGithubRepository } from "@cdktf/provider-github/lib/data-github-rep
import { IssueLabel } from "@cdktf/provider-github/lib/issue-label";
import { BranchProtection } from "@cdktf/provider-github/lib/branch-protection";
import { TeamRepository } from "@cdktf/provider-github/lib/team-repository";
import { RepositoryDependabotSecurityUpdates } from "@cdktf/provider-github/lib/repository-dependabot-security-updates";
import { RepositoryWebhook } from "@cdktf/provider-github/lib/repository-webhook";

export interface ITeam {
Expand Down Expand Up @@ -165,6 +166,13 @@ export class GithubRepository extends Construct {
...config,
repository: this.resource,
});

if (!name.endsWith("-go")) {
new RepositoryDependabotSecurityUpdates(this, "dependabot-security", {
repository: this.resource.name,
enabled: true,
});
}
}

addSecret(name: string) {
Expand Down Expand Up @@ -194,5 +202,12 @@ export class GithubRepositoryFromExistingRepository extends Construct {
...config,
repository: this.resource,
});

if (!config.repositoryName.endsWith("-go")) {
new RepositoryDependabotSecurityUpdates(this, "dependabot-security", {
repository: this.resource.name,
enabled: true,
});
}
}
}

0 comments on commit a860e4a

Please sign in to comment.