Skip to content

#12 adding feature request to clone repo #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.