Skip to content

Commit

Permalink
feat: add support to archive repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
dirien committed Sep 28, 2024
1 parent 000f15f commit 699ad87
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions 02-repositories/aquasec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ name: pulumi-aquasec
description: Pulumi provider for Aquasec
type: provider
template: pulumi-tf-provider-boilerplate
archived: true
1 change: 1 addition & 0 deletions src/configTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const Repository = RT.Record({
import: RT.Boolean.optional(),
template: RT.String.optional(),
removable: RT.Boolean.optional(),
archived: RT.Boolean.optional(),
})

export type Team = Static<typeof Team>
Expand Down
11 changes: 8 additions & 3 deletions src/github/repositories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface RepositoryArgs {
import: boolean;
template: pulumi.Input<string> | undefined;
removable: boolean;
archived: boolean;
}
abstract class BaseRepository extends pulumi.ComponentResource {

Expand All @@ -32,17 +33,18 @@ abstract class BaseRepository extends pulumi.ComponentResource {
name: name,
description: args.description,
hasWiki: false,
hasIssues: true,
hasIssues: args.archived === true ? false : true,
hasDownloads: args.hasDownloads || false,
hasProjects: false,
visibility: 'public',
deleteBranchOnMerge: true,
vulnerabilityAlerts: true,
vulnerabilityAlerts: args.archived === true ? false : true,
topics: args.topics,
template: args.template ? {
owner: 'pulumi',
repository: args.template,
} : undefined
} : undefined,
archived: args.archived === true ? true : false,
},
{
parent: this,
Expand Down Expand Up @@ -197,6 +199,7 @@ export function configureRepositories(repositoryArgs: Repository[], allTeams: Ma
import: repositoryInfo.import || false,
template: repositoryInfo.template,
removable: repositoryInfo.removable || false,
archived: repositoryInfo.archived === true ? true : false,
}).repository);
break;
}
Expand All @@ -211,6 +214,7 @@ export function configureRepositories(repositoryArgs: Repository[], allTeams: Ma
import: repositoryInfo.import || false,
template: repositoryInfo.template,
removable: repositoryInfo.removable || false,
archived: repositoryInfo.archived === true ? true : false,
}).repository);
break;
}
Expand All @@ -225,6 +229,7 @@ export function configureRepositories(repositoryArgs: Repository[], allTeams: Ma
import: repositoryInfo.import || false,
template: repositoryInfo.template,
removable: repositoryInfo.removable || false,
archived: repositoryInfo.archived === true ? true : false,
}).repository
);
break;
Expand Down

0 comments on commit 699ad87

Please sign in to comment.