Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -36,6 +36,23 @@ def push_to_github(local_path, repo_url, github_token):
|
|
36 |
def main():
|
37 |
st.title("GitHub Repository Cloner and Uploader")
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
# Input for source repository
|
40 |
source_repo = st.text_input("Source GitHub Repository URL",
|
41 |
value="https://github.com/AaronCWacker/AIExamples-8-24-Streamlit/")
|
@@ -45,9 +62,14 @@ def main():
|
|
45 |
value="https://github.com/AaronCWacker/AIExample-Clone/")
|
46 |
|
47 |
# GitHub token input
|
48 |
-
github_token = st.text_input("GitHub Personal Access Token", type="password"
|
|
|
49 |
|
50 |
if st.button("Clone and Upload"):
|
|
|
|
|
|
|
|
|
51 |
with st.spinner("Processing..."):
|
52 |
# Download the source repository
|
53 |
local_path = "./temp_repo"
|
|
|
36 |
def main():
|
37 |
st.title("GitHub Repository Cloner and Uploader")
|
38 |
|
39 |
+
# Instructions for obtaining GitHub token
|
40 |
+
st.sidebar.title("How to Get Your GitHub Token")
|
41 |
+
st.sidebar.markdown("""
|
42 |
+
1. Go to your GitHub account settings
|
43 |
+
2. Click on 'Developer settings' in the left sidebar
|
44 |
+
3. Click on 'Personal access tokens' and then 'Tokens (classic)'
|
45 |
+
4. Click 'Generate new token' and select 'Generate new token (classic)'
|
46 |
+
5. Give your token a descriptive name
|
47 |
+
6. Select the following scopes:
|
48 |
+
- repo (all)
|
49 |
+
- delete_repo
|
50 |
+
7. Click 'Generate token' at the bottom of the page
|
51 |
+
8. Copy your new token immediately (you won't be able to see it again!)
|
52 |
+
|
53 |
+
**Important:** Keep your token secret and secure. Treat it like a password!
|
54 |
+
""")
|
55 |
+
|
56 |
# Input for source repository
|
57 |
source_repo = st.text_input("Source GitHub Repository URL",
|
58 |
value="https://github.com/AaronCWacker/AIExamples-8-24-Streamlit/")
|
|
|
62 |
value="https://github.com/AaronCWacker/AIExample-Clone/")
|
63 |
|
64 |
# GitHub token input
|
65 |
+
github_token = st.text_input("GitHub Personal Access Token", type="password",
|
66 |
+
help="Paste your GitHub token here. See sidebar for instructions on how to get it.")
|
67 |
|
68 |
if st.button("Clone and Upload"):
|
69 |
+
if not github_token:
|
70 |
+
st.error("Please enter a GitHub token. See the sidebar for instructions.")
|
71 |
+
return
|
72 |
+
|
73 |
with st.spinner("Processing..."):
|
74 |
# Download the source repository
|
75 |
local_path = "./temp_repo"
|