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
3 changes: 3 additions & 0 deletions components/publicRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export interface PublicRepoArgs {
topics?: Input<Input<string>[]>;
/** Passed through to the repository resource, for adopting one that already exists. */
repoOptions?: CustomResourceOptions;
/** Whether Dependabot raises alerts for the repository. Defaults to enabled. */
vulnerabilityAlerts?: Input<boolean>;
}

export class PublicRepo extends Repo {
Expand All @@ -51,6 +53,7 @@ export class PublicRepo extends Repo {
topics: args.topics,
},
repoOptions: args.repoOptions,
vulnerabilityAlerts: args.vulnerabilityAlerts,
},
opts,
);
Expand Down
5 changes: 4 additions & 1 deletion components/repo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as gh from '@pulumi/github';
import { ComponentResource, ComponentResourceOptions, CustomResourceOptions } from '@pulumi/pulumi';
import { ComponentResource, ComponentResourceOptions, CustomResourceOptions, Input } from '@pulumi/pulumi';

export interface RepoArgs {
overrides: Partial<gh.RepositoryArgs>;
Expand All @@ -9,6 +9,8 @@ export interface RepoArgs {
* alias for one whose URN is moving.
*/
repoOptions?: CustomResourceOptions;
/** Whether Dependabot raises alerts for the repository. Defaults to enabled. */
vulnerabilityAlerts?: Input<boolean>;
}

export abstract class Repo extends ComponentResource {
Expand Down Expand Up @@ -38,6 +40,7 @@ export abstract class Repo extends ComponentResource {

const vulnerabilityAlerts = new gh.RepositoryVulnerabilityAlerts(name, {
repository: repo.name,
enabled: args.vulnerabilityAlerts,
}, { parent: this });
Comment on lines 41 to 44

this.repo = repo;
Expand Down
4 changes: 4 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ const pkgs = new PublicRepo('pkgs', {
description: 'Mini nixpkgs — personal Nix package collection',
topics: ['nix', 'nixpkgs', 'nix-flake'],
githubChecks: ['build (x86_64-linux)'],
// Lockfiles under pkgs/ record what upstream projects pin, not what this
// repo depends on. Their advisories are unactionable here and accumulate
// with every package added.
vulnerabilityAlerts: false,
});

const terraform2crd = new PublicRepo('terraform2crd', {
Expand Down
Loading