{"id":18997798,"url":"https://github.com/wtfjoke/cdk-github","last_synced_at":"2025-04-22T14:25:38.910Z","repository":{"id":37021544,"uuid":"393407033","full_name":"WtfJoke/cdk-github","owner":"WtfJoke","description":"CDK Constructs for Github resources","archived":false,"fork":false,"pushed_at":"2024-09-01T02:01:50.000Z","size":1596,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-15T09:43:39.863Z","etag":null,"topics":["aws","cdk","cdk-construct","cdk-construct-library","cdk-constructs","github"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WtfJoke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-06T14:46:55.000Z","updated_at":"2025-02-26T15:31:36.000Z","dependencies_parsed_at":"2024-05-01T02:37:55.873Z","dependency_job_id":"f4137312-ed48-4989-b2ef-eb01baf2d286","html_url":"https://github.com/WtfJoke/cdk-github","commit_stats":{"total_commits":77,"total_committers":4,"mean_commits":19.25,"dds":"0.35064935064935066","last_synced_commit":"23f05298637cfc600f9115ca660abc05739fac20"},"previous_names":[],"tags_count":57,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WtfJoke%2Fcdk-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WtfJoke%2Fcdk-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WtfJoke%2Fcdk-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WtfJoke%2Fcdk-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WtfJoke","download_url":"https://codeload.github.com/WtfJoke/cdk-github/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250257310,"owners_count":21400697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cdk","cdk-construct","cdk-construct-library","cdk-constructs","github"],"created_at":"2024-11-08T17:42:26.940Z","updated_at":"2025-04-22T14:25:38.884Z","avatar_url":"https://github.com/WtfJoke.png","language":"TypeScript","readme":"[![npm version](https://badge.fury.io/js/cdk-github.svg)](https://badge.fury.io/js/cdk-github)\n[![PyPI version](https://badge.fury.io/py/cdk-github.svg)](https://badge.fury.io/py/cdk-github)\n[![NuGet version](https://badge.fury.io/nu/cdkgithub.svg)](https://badge.fury.io/nu/cdkgithub)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.wtfjoke/cdk-github/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.wtfjoke/cdk-github/)\n[![release](https://github.com/wtfjoke/cdk-github/actions/workflows/release.yml/badge.svg)](https://github.com/wtfjoke/cdk-github/actions/workflows/release.yml)  \n![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge) [![View on Construct Hub](https://constructs.dev/badge?package=cdk-github)](https://constructs.dev/packages/cdk-github)\n# CDK-GitHub\n\nGitHub Constructs for use in [AWS CDK](https://aws.amazon.com/cdk/) .\n\nThis project aims to make GitHub's API accessible through CDK with various helper constructs to create resources in GitHub.    \nThe target is to replicate most of the functionality of the official [Terraform GitHub Provider](https://registry.terraform.io/providers/integrations/github/latest/docs).\n\nInternally [AWS CloudFormation custom resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html) and [octokit](https://github.com/octokit/core.js) are used to manage GitHub resources (such as Secrets).\n\n# 🔧 Installation\n\nJavaScript/TypeScript:  \n`npm install cdk-github`\n\nPython:  \n`pip install cdk-github`\n\nJava\n\u003cdetails\u003e \n  \u003csummary\u003eMaven:\u003c/summary\u003e\n\n  ```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.wtfjoke\u003c/groupId\u003e\n    \u003cartifactId\u003ecdk-github\u003c/artifactId\u003e\n    \u003cversion\u003eVERSION\u003c/version\u003e\n\u003c/dependency\u003e\n  ```\n\u003c/details\u003e\n\u003cdetails\u003e \n  \u003csummary\u003eGradle:\u003c/summary\u003e\n\n   `implementation 'io.github.wtfjoke:cdk-github:VERSION'`\n\u003c/details\u003e\n\u003cdetails\u003e \n  \u003csummary\u003eGradle (Kotlin):\u003c/summary\u003e\n\n   `implementation(\"io.github.wtfjoke:cdk-github:VERSION\")`\n\u003c/details\u003e\n\nC#   \nSee https://www.nuget.org/packages/CdkGithub\n\n# 📚 Constructs\n\nThis library provides the following constructs:\n- [ActionEnvironmentSecret](API.md#actionenvironmentsecret-) - Creates a [GitHub Action environment secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-an-environment) from a given AWS Secrets Manager secret.\n- [ActionSecret](API.md#actionsecret-) - Creates a [GitHub Action (repository) secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) from a given AWS Secrets Manager secret.\n- [GitHubResource](API.md#githubresource-) - Creates an arbitrary GitHub resource. When no suitable construct fits your needs, this construct can be used to create most GitHub resources. It is an L1 construct.\n\n# 🔓 Authentication\nCurrently the constructs only support authentication via a [GitHub Personal Access Token](https://github.com/settings/tokens/new). The token needs to be a stored in a AWS SecretsManager Secret and passed to the construct as parameter.    \n\n# 👩‍🏫 Examples\nThe API documentation and examples in different languages are available on [Construct Hub](https://constructs.dev/packages/cdk-github).   \nAll (typescript) examples can be found in the folder [examples](src/examples/).\n\n## ActionSecret\n```typescript\nimport { Secret } from 'aws-cdk-lib/aws-secretsmanager';\nimport { ActionSecret } from 'cdk-github';\n\nexport class ActionSecretStack extends Stack {\n  constructor(scope: Construct, id: string, props?: StackProps) {\n    super(scope, id, props);\n\n    const githubTokenSecret = Secret.fromSecretNameV2(this, 'ghSecret', 'GITHUB_TOKEN');\n    const sourceSecret = Secret.fromSecretNameV2(this, 'secretToStoreInGitHub', 'testcdkgithub');\n\n    new ActionSecret(this, 'GitHubActionSecret', {\n      githubTokenSecret,\n      repository: { name: 'cdk-github', owner: 'wtfjoke' },\n      repositorySecretName: 'A_RANDOM_GITHUB_SECRET',\n      sourceSecret,\n    });\n  }\n}\n```\n\n\n## ActionEnvironmentSecret\n```typescript\nimport { Secret } from 'aws-cdk-lib/aws-secretsmanager';\nimport { ActionEnvironmentSecret } from 'cdk-github';\n\nexport class ActionEnvironmentSecretStack extends Stack {\n  constructor(scope: Construct, id: string, props?: StackProps) {\n    super(scope, id, props);\n\n    const githubTokenSecret = Secret.fromSecretNameV2(this, 'ghSecret', 'GITHUB_TOKEN');\n    const sourceSecret = Secret.fromSecretNameV2(this, 'secretToStoreInGitHub', 'testcdkgithub');\n\n    new ActionEnvironmentSecret(this, 'GitHubActionEnvironmentSecret', {\n      githubTokenSecret,\n      environment: 'dev',\n      repository: { name: 'cdk-github', owner: 'wtfjoke' },\n      repositorySecretName: 'A_RANDOM_GITHUB_SECRET',\n      sourceSecret,\n    });\n  }\n}\n```\n\n## GitHubResource\n```typescript\nimport { Secret } from 'aws-cdk-lib/aws-secretsmanager';\nimport { StringParameter } from 'aws-cdk-lib/aws-ssm';\nimport { GitHubResource } from 'cdk-github';\n\n\nexport class GitHubResourceIssueStack extends Stack {\n  constructor(scope: Construct, id: string, props?: StackProps) {\n    super(scope, id, props);\n\n    const githubTokenSecret = Secret.fromSecretNameV2(this, 'ghSecret', 'GITHUB_TOKEN');\n    // optional\n    const writeResponseToSSMParameter = StringParameter.fromSecureStringParameterAttributes(this, 'responseBody', { parameterName: '/cdk-github/encrypted-response' });\n\n    new GitHubResource(this, 'GitHubIssue', {\n      githubTokenSecret,\n      createRequestEndpoint: 'POST /repos/WtfJoke/dummytest/issues',\n      createRequestPayload: JSON.stringify({ title: 'Testing cdk-github', body: \"I'm opening an issue by using aws cdk 🎉\", labels: ['bug'] }),\n      createRequestResultParameter: 'number',\n      deleteRequestEndpoint: 'PATCH /repos/WtfJoke/dummytest/issues/:number',\n      deleteRequestPayload: JSON.stringify({ state: 'closed' }),\n      writeResponseToSSMParameter,\n    });\n  }\n}\n```\n\n# 💖 Contributing\n\nContributions of all kinds are welcome! Check out our [contributing guide](CONTRIBUTING.md).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtfjoke%2Fcdk-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwtfjoke%2Fcdk-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtfjoke%2Fcdk-github/lists"}