Skip to content

Commit

Permalink
feat: support github actions secrets (#53)
Browse files Browse the repository at this point in the history
Usage:

```typescript
new GithubCustomResource(stack, "ActionsSecret", {
  onCreate: {
    endpoint: "actions",
    method: "createOrUpdateRepoSecret",
    parameters: {
      owner: "pepperize",
      repo: "cdk-github",
      secret_name: "any-name",
      value: ActionsSecret.fromSecretsManager(secret, "any-field"),
    },
    outputPaths: [],
    physicalResourceId: custom_resources.PhysicalResourceId.of("any-id"),
  },
  authOptions: AuthOptions.appAuth(authSecret),
});
```

Fixes #7
  • Loading branch information
mergify[bot] authored Feb 1, 2023
2 parents ea5a40e + bf6f611 commit 45fecf0
Show file tree
Hide file tree
Showing 21 changed files with 974 additions and 60 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const project = new AwsCdkConstructLibrary({
"construct",
"custom-resource",
"github",
"actions",
"secret",
"provider",
"repository",
"teams",
Expand All @@ -38,8 +40,11 @@ const project = new AwsCdkConstructLibrary({
"@octokit/types",
"@pepperize/projen-awscdk-construct@latest",
"@types/aws-lambda",
"@types/libsodium-wrappers",
"aws-lambda",
"aws-sdk",
"libsodium",
"libsodium-wrappers",
],

versionrcOptions: {
Expand Down Expand Up @@ -69,6 +74,10 @@ const project = new AwsCdkConstructLibrary({
gitignore: ["cdk.out"],
});

project.eslint?.allowDevDeps("src/custom-resource-provider/encrypt.ts");
project.eslint?.allowDevDeps("src/custom-resource-provider/execute-github-api-call.ts");
project.eslint?.allowDevDeps("src/custom-resource-provider/get-secret-value.ts");

project.gitpod?.addCustomTask({
name: "setup",
init: "yarn install && npx projen build",
Expand Down
194 changes: 192 additions & 2 deletions API.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 45fecf0

Please sign in to comment.