From b5bfcca30009002923e0c919d4324aebf0af55ee Mon Sep 17 00:00:00 2001 From: Joel Date: Tue, 19 Jul 2022 02:28:26 -0400 Subject: [PATCH] #12 adding feature request to clone repo --- app.py | 17 ++++++++++++++-- .../.github/ISSUE_TEMPLATE/feature_request.md | 20 +++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 repo-template-files/.github/ISSUE_TEMPLATE/feature_request.md diff --git a/app.py b/app.py index fc3e5ce..ead23f4 100644 --- a/app.py +++ b/app.py @@ -1,8 +1,7 @@ from starlette.applications import Starlette from starlette.responses import PlainTextResponse -from starlette.routing import Route, Mount from starlette.templating import Jinja2Templates -from starlette.staticfiles import StaticFiles +from starlette.routing import Route import os import requests import json @@ -123,6 +122,20 @@ async def githubcallback(request): headers=headers, data=json.dumps(data), ) + with open("./repo-template-files/.github/ISSUE_TEMPLATE/feature_request.md") as fp: + feature_request_md_b64 = base64.b64encode(release_yml.encode("utf-8")).decode( + "utf-8" + ) + data = { + "message": "create feature_request_md", + "committer": {"name": username, "email": email}, + "content": feature_request_md_b64, + } + req = requests.put( + f"https://api.github.com/repos/{username}/{repo_name}/contents/.github/ISSUE_TEMPLATE/feature_request.md", + headers=headers, + data=json.dumps(data), + ) return templates.TemplateResponse( "welcome.html", {"repo_url": repo_url, "request": request} diff --git a/repo-template-files/.github/ISSUE_TEMPLATE/feature_request.md b/repo-template-files/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/repo-template-files/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here.