Skip to content

Commit

Permalink
Merge pull request #268 from WtfJoke/fix/nitpicking53
Browse files Browse the repository at this point in the history
chore: Favor secret name "github-token" over "test"
  • Loading branch information
mergify[bot] authored Feb 5, 2023
2 parents 40a0dbb + 8bbf030 commit 2011d23
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion API.md

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

14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ yarn build
6. Import your secret

```typescript
const secret = secrets_manager.Secret.fromSecretNameV2(stack, "Auth", "cdk-github/test");
const secret = secrets_manager.Secret.fromSecretNameV2(stack, "Auth", "cdk-github/github-token");
```

7. Configure GitHub App authenticate as an installation
Expand Down Expand Up @@ -167,7 +167,7 @@ Lookup the secret in your AWS CDK app:

```typescript
// 👇Lookup your secret containing the AuthOptions
const secret = secrets_manager.Secret.fromSecretNameV2(stack, "Auth", "cdk-github/test");
const secret = secrets_manager.Secret.fromSecretNameV2(stack, "Auth", "cdk-github/github-token");
// 👇This will send the secret arn to the custom resource handler
const authOptions = AuthOptions.appAuth(secret);
```
Expand All @@ -190,7 +190,7 @@ Just add your PAT to an SSM StringParameter

```typescript
// 👇Lookup your parameter containing the TOKEN
const parameter = ssm.StringParameter.fromStringParameterName(stack, "Auth", "cdk-github/test");
const parameter = ssm.StringParameter.fromStringParameterName(stack, "Auth", "cdk-github/github-token");
// 👇This will send the parameter arn to the custom resource handler
const authOptions = AuthOptions.tokenAuth(parameter);
```
Expand All @@ -209,7 +209,7 @@ const authOptions = AuthOptions.unauthenticated();
[@octokit/plugin-rest-endpoint-methods](https://github.com/octokit/plugin-rest-endpoint-methods.js/#usage)

```typescript
const auth = secrets_manager.Secret.fromSecretNameV2(stack, "Auth", "cdk-github/test");
const auth = secrets_manager.Secret.fromSecretNameV2(stack, "Auth", "cdk-github/github-token");

const repo = new GithubCustomResource(stack, "GithubRepo", {
onCreate: {
Expand Down Expand Up @@ -260,7 +260,7 @@ Manages an environment secret. Will fetch the source AWS SecretsManager secret a

```typescript
// 👇The GitHub API authentication secret
const auth = secrets_manager.Secret.fromSecretNameV2(scope, "Auth", "cdk-github/test");
const auth = secrets_manager.Secret.fromSecretNameV2(scope, "Auth", "cdk-github/github-token");

// 👇The AWS SecretsManager Secret to configure as GitHub Action secret.
const secret = secrets_manager.Secret.fromSecretNameV2(scope, "Secret", "any-secret/example");
Expand Down Expand Up @@ -289,7 +289,7 @@ Manage an GitHib Actions organization secret. Will fetch the source AWS SecretsM

```typescript
// 👇The GitHub API authentication secret
const auth = secrets_manager.Secret.fromSecretNameV2(scope, "Auth", "cdk-github/test");
const auth = secrets_manager.Secret.fromSecretNameV2(scope, "Auth", "cdk-github/github-token");

// 👇The AWS SecretsManager Secret to configure as GitHub Action secret.
const secret = secrets_manager.Secret.fromSecretNameV2(scope, "Secret", "any-secret/example");
Expand All @@ -315,7 +315,7 @@ Manage an GitHib Actions Repository secret. Will fetch the source AWS SecretsMan

```typescript
// 👇The GitHub API authentication secret
const auth = secrets_manager.Secret.fromSecretNameV2(scope, "Auth", "cdk-github/test");
const auth = secrets_manager.Secret.fromSecretNameV2(scope, "Auth", "cdk-github/github-token");

// 👇The AWS SecretsManager Secret to configure as GitHub Action secret.
const secret = secrets_manager.Secret.fromSecretNameV2(scope, "Secret", "any-secret/example");
Expand Down
2 changes: 0 additions & 2 deletions src/custom-resource-provider/handler.lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ export const handler: OnEventHandler = async (event: OnEventRequest): Promise<On
const octokit = new Octokit(octokitOptions);

try {
// https://github.com/octokit/plugin-rest-endpoint-methods.js/#usage
// @ts-ignore
const response = await executeGithubApiCall(octokit, call);

console.debug("Response: %j", response);
Expand Down
2 changes: 1 addition & 1 deletion src/github-actions-secret-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface GithubActionsSecretEnvironmentProps extends GithubCustomResourc
*
* ```typescript
* // The GitHub API authentication secret
* const auth = secrets_manager.Secret.fromSecretNameV2(scope, "Auth", "cdk-github/test");
* const auth = secrets_manager.Secret.fromSecretNameV2(scope, "Auth", "cdk-github/github-token");
*
* // The AWS SecretsManager Secret to configure as GitHub Action secret.
* const secret = secrets_manager.Secret.fromSecretNameV2(scope, "Secret", "any-secret/example");
Expand Down
2 changes: 1 addition & 1 deletion src/github-actions-secret-organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface GithubActionsSecretOrganizationProps extends GithubCustomResour
*
* ```typescript
* // The GitHub API authentication secret
* const auth = secrets_manager.Secret.fromSecretNameV2(scope, "Auth", "cdk-github/test");
* const auth = secrets_manager.Secret.fromSecretNameV2(scope, "Auth", "cdk-github/github-token");
*
* // The AWS SecretsManager Secret to configure as GitHub Action secret.
* const secret = secrets_manager.Secret.fromSecretNameV2(scope, "Secret", "any-secret/example");
Expand Down
2 changes: 1 addition & 1 deletion src/github-actions-secret-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface GithubActionsSecretRepositoryProps extends GithubCustomResource
*
* ```typescript
* // The GitHub API authentication secret
* const auth = secrets_manager.Secret.fromSecretNameV2(scope, "Auth", "cdk-github/test");
* const auth = secrets_manager.Secret.fromSecretNameV2(scope, "Auth", "cdk-github/github-token");
*
* // The AWS SecretsManager Secret to configure as GitHub Action secret.
* const secret = secrets_manager.Secret.fromSecretNameV2(scope, "Secret", "any-secret/example");
Expand Down
2 changes: 1 addition & 1 deletion src/github-custom-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export abstract class GithubCustomResourceBase extends Construct {

/**
* ```typescript
* const auth = secrets_manager.Secret.fromSecretNameV2(scope, "Auth", "cdk-github/test");
* const auth = secrets_manager.Secret.fromSecretNameV2(scope, "Auth", "cdk-github/github-token");
*
* new GithubCustomResource(scope, "GithubRepo", {
* onCreate: {
Expand Down

0 comments on commit 2011d23

Please sign in to comment.