{"id":15760024,"url":"https://github.com/padupe/lambda-create-repository-python","last_synced_at":"2025-07-26T10:35:11.520Z","repository":{"id":38238093,"uuid":"496023821","full_name":"padupe/lambda-create-repository-python","owner":"padupe","description":"Lambda for repositories creation at GitHub.","archived":false,"fork":false,"pushed_at":"2022-06-15T11:50:22.000Z","size":425,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-14T09:24:38.174Z","etag":null,"topics":["lambda","python3","serverless"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/padupe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-24T23:58:23.000Z","updated_at":"2022-06-10T16:12:12.000Z","dependencies_parsed_at":"2022-09-13T12:00:18.492Z","dependency_job_id":null,"html_url":"https://github.com/padupe/lambda-create-repository-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/padupe/lambda-create-repository-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padupe%2Flambda-create-repository-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padupe%2Flambda-create-repository-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padupe%2Flambda-create-repository-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padupe%2Flambda-create-repository-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/padupe","download_url":"https://codeload.github.com/padupe/lambda-create-repository-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padupe%2Flambda-create-repository-python/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267150480,"owners_count":24043473,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["lambda","python3","serverless"],"created_at":"2024-10-04T10:40:38.552Z","updated_at":"2025-07-26T10:35:11.466Z","avatar_url":"https://github.com/padupe.png","language":"Python","readme":"![img](https://github.com/padupe/lambda-create-repository-python/blob/main/assets/banner_project.png)\r\n\u003cdiv align=\"center\"\u003e\r\n\r\n![GitHub Repo stars](https://img.shields.io/github/stars/padupe/lambda-create-repository-python?color=blue\u0026label=stars)\r\n![GitHub forks](https://img.shields.io/github/forks/padupe/lambda-create-repository-python?color=blue\u0026label=forks)\r\n![GitHub last commit](https://img.shields.io/github/last-commit/padupe/lambda-create-repository-python?color=blue\u0026label=last%20commit)\r\n\r\n\u003c/div\u003e\r\n\r\n# lambda-create-repository-python\r\n\u003e Check the Documentation in pt-BR by clicking 🇧🇷 [here](https://github.com/padupe/lambda-create-repository-python/blob/main/docs/README-pt-BR.md 'here').\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n\r\n[![Technology][python-image]][python-url]\r\n[![Technology][aws-lambda-image]][aws-lambda-url]\u003cbr\u003e\r\n\r\n![img](https://img.shields.io/badge/python-v3.8-blue)\r\n![img](https://img.shields.io/badge/mdutils-v1.3.1-blue)\r\n![img](https://img.shields.io/badge/requests-v2.25.1-blue)\r\n\r\n\u003c/div\u003e\r\n\r\n[python-url]: https://www.python.org/\r\n[python-image]: https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54\r\n\r\n[aws-lambda-url]: https://aws.amazon.com/pt/lambda/\r\n[aws-lambda-image]: https://img.shields.io/badge/aws.lambda-yellow?style=for-the-badge\u0026logo=amazon\u0026logoColor=black\r\n\r\n## Index\r\n\u003c!--ts--\u003e\r\n* [lambda-create-repository-python](#lambda-create-repository-python)\r\n    * [Index](#index)\r\n    * [Description](#description)\r\n    * [Flow](#flow)\r\n    * [Business Context](#bussiness-context)\r\n    * [Project Dependencies](#project-dependencies)\r\n    * [Payload](#payload)\r\n        * [Payload Structure](#payload-structure)\r\n        * [Payload Example (Complete)](#payload-example-complete)\r\n        * [Payload Example (Simple)](#payload-example-simple)\r\n    * [Status Code](#status-code)\r\n    * [Local Development](#local-development)\r\n        * [Requirements](#requirements)\r\n        * [Step by Step](#step-by-step)\r\n\u003c!--te--\u003e\r\n\r\n## Description\r\nCreates a Repository on GitHub, using the service's API.\r\nIn addition, it adds the `\"deploys\"` and `\"{Owner-Squad}-ADMIN\"` teams of the Project Owner Squad and performs the dynamic creation of the `README.md`.\r\n\r\n## Flow\r\n![img](https://github.com/padupe/lambda-create-repository-python/blob/main/docs/flow-lambda-create-repository.drawio.png)\r\n\r\n## Bussiness Context\r\nAllow a dynamic management in the organization's repository creation process.\u003cbr\u003e\r\n\r\nTeam Tech \u003c-\u003e **Team responsible for managing GitHub in the Organization** \u003c-\u003e GitHub\r\n\r\n## Project Dependencies\r\n- [mdutils](https://pypi.org/project/mdutils/ 'mdutils'): This Python package contains a set of basic tools that can help to create a markdown file while running a Python code;\u003cbr\u003e\r\n- [requests](https://pypi.org/project/requests/ 'requests'): Requests is a simple HTTP library.\u003cbr\u003e\r\n\r\n## Payload\r\n\r\n### Payload Structure\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n\r\n|Parameter|Value|Required|\r\n|:---:|:---:|:---:|\r\n|`repository_title`|`string`|`true`|\r\n|`team_owner`|`string`|`true`|\r\n|`private`|`boolean`|`true`|\r\n|`about`|`string`|`true`|\r\n|`description`|`string`|`true`|\r\n|`business_context`|`string`|`true`|\r\n|`requirements`|`array`|`true`|\r\n|`integration`|`array`|`true`|\r\n\r\n\u003c/div\u003e\r\n\r\n### Payload Example (Complete)\r\n```json\r\n{\r\n    \"repository_title\": \"Repository-Test\",\r\n    \"team_owner\": \"lambda-test\",\r\n    \"private\": true,\r\n    \"about\": \"Repository create with Lambda\",\r\n    \"description\": \"An repository test.\",\r\n    \"business_context\": \"Repository test with Lambda\",\r\n    \"requirements\": [\r\n        \"Nodejs\",\r\n        \"Docker\"\r\n    ],\r\n    \"integration\": [\r\n        \"Life-Cycle\",\r\n        \"Order-Service\"\r\n    ]\r\n}\r\n```\r\n\u003e NOTE: The \"private\" parameter can be passed as an empty string, as by default this property is \"true\".\r\n\r\n### Payload Example (Simple)\r\n```json\r\n{\r\n    \"repository_title\": \"Repository-Test-Two\",\r\n    \"team_owner\": \"lambda-test\",\r\n    \"private\": \"\",\r\n    \"about\": \"Repository create with Lambda\",\r\n    \"description\": \"An repository test.\",\r\n    \"business_context\": \"Repository test with Lambda\",\r\n    \"requirements\": [],\r\n    \"integration\": []\r\n}\r\n```\r\n\u003e NOTE: The \"private\" parameter can be passed as an empty string, as by default this property is \"true\".\r\n\r\n## Status Code\r\n- **201**\r\n    - Repository Created\r\n- **404**\r\n    - Failure to find team `{team_owner}` at `{ORGANIZATION}`\r\n    - Repository `{repository_title}` already exists at `{ORGANIZATION}`\r\n- **500**\r\n    - Error while running lambda: `{err}`\r\n\r\n## Local Development\r\n\r\n### Requirements:\r\n- CLI [Serverless](https://www.serverless.com/framework/docs/getting-started);\r\n- Pip3;\r\n- Python 3.8 =\u003c.\r\n\r\n### Step by Step\r\n1. Rename `serverless.yaml` to `serverles-prd.yaml`;\r\n\r\n2. Rename `serverless-local.yaml` to `serverless.yaml`;\r\n\r\n3. In the `configs` directory, in the [`constants.py`](https://github.com/padupe/lambda-create-repository-python/blob/main/configs/constants.py) file, enter a Personal Access Token (PAT) with Organization \"Owner\" privileges (permission to create repositories, link teams, etc.) in the `PAT_USER` constant;\r\n\r\n4. In the `configs` directory, in the [`constants.py`](https://github.com/padupe/lambda-create-repository-python/blob/main/configs/constants.py) file, enter the name of the organization you belong to in the `ORGANIZATION` constant;\r\n\r\n    4.1 If your organization does not have auxiliary teams (`\"{Owner-Squad}-ADMIN\"`, `\"deploys\"`, etc), comment out (or remove) lines 21 and 22 of the [`app.py`](https://github.com/padupe/lambda-create-repository-python/blob/main/app/app.py) file.\r\n\r\n5. Run:\r\n```\r\nserverless invoke local --function create-repository --path example.json\r\n```\r\n\r\n**NOTE:**\r\nA repository will be created with the name **`repository-test`** in your organization.\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpadupe%2Flambda-create-repository-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpadupe%2Flambda-create-repository-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpadupe%2Flambda-create-repository-python/lists"}