Skip to content

Commit

Permalink
#12 adding feature request to clone repo
Browse files Browse the repository at this point in the history
  • Loading branch information
joeltejeda committed Jul 19, 2022
1 parent 06db3b2 commit b5bfcca
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
17 changes: 15 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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}
Expand Down
20 changes: 20 additions & 0 deletions repo-template-files/.github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit b5bfcca

Please sign in to comment.