Skip to content
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

appssubmitter finial version #128

Merged
merged 24 commits into from
Sep 9, 2024
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9beb1e2
appssubmitter finial version
SeverusYixin Jul 19, 2024
87323f1
File Selection Function Update
SeverusYixin Jul 22, 2024
078174b
In this version, after the PR is merged, it will also close the corre…
SeverusYixin Jul 22, 2024
5b44bda
in this version, it has finish these changes "Remove the submitter na…
SeverusYixin Jul 24, 2024
2e4bae1
All the “Remove submitter's name” has been completed under this versi…
SeverusYixin Jul 26, 2024
603e579
update for add a "tags/types/.." retriever
SeverusYixin Aug 12, 2024
849e37d
update for adding tags which are not in the tags select list
SeverusYixin Aug 19, 2024
a17af85
Delete the specific mapping in the application and renew our data source
SeverusYixin Aug 19, 2024
2596d75
Merge branch 'main' into app_for_adding_entries
haesleinhuepf Aug 26, 2024
2ea918d
update with Docstring
SeverusYixin Aug 27, 2024
738d248
Merge branch 'app_for_adding_entries' of https://github.com/NFDI4BIOI…
SeverusYixin Aug 27, 2024
58df5a7
Update the function with "def get_github_repository(repository):" a…
SeverusYixin Aug 28, 2024
2f49b88
Update the index_2 to make sure it is only about the app submitter.
SeverusYixin Aug 28, 2024
019ec5e
Update the introduction with the latest version
SeverusYixin Aug 28, 2024
94c66c8
Update index_2.md
SeverusYixin Aug 29, 2024
93ce49f
update for the import function and removal of the yml file selector
SeverusYixin Sep 5, 2024
7506ec6
make sure all the read and write is "utf-8"
SeverusYixin Sep 5, 2024
25ea9ce
renamed documentation page to reasonable filename
haesleinhuepf Sep 9, 2024
4639311
make the app-submitter just append a new entry by the end, stop it to…
haesleinhuepf Sep 9, 2024
329c52f
minor documentation update
haesleinhuepf Sep 9, 2024
7d488db
change order of fields in form
haesleinhuepf Sep 9, 2024
0224804
remove unused code
haesleinhuepf Sep 9, 2024
6e093bd
clean up code, add comments, removed unused imports
haesleinhuepf Sep 9, 2024
327a342
renamed app in documentation to be consistent
haesleinhuepf Sep 9, 2024
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
55 changes: 55 additions & 0 deletions scripts/appsubmitter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import os
import streamlit as st
from github import Github

# GitHub authentication
GITHUB_API_KEY = os.getenv('GITHUB_API_KEY') # Get the API key from environment variable
if not GITHUB_API_KEY:
st.error("GitHub API Key is not set in the environment variables.")
st.stop()

try:
g = Github(GITHUB_API_KEY)
repo = g.get_repo("SeverusYixin/Test_Appsubmitter") # My GitHub Repositories for test Appsubmitter
except Exception as e:
st.error(f"Failed to authenticate with GitHub: {e}")
st.stop()

st.title("GitHub Issue and Pull Request Creator")

st.markdown("""
Welcome to the GitHub Issue and Pull Request Creator app!

Use this form to submit new issues or pull requests to our GitHub repository.
Please provide the necessary details in the fields below and click "Submit".
""")

# Form to collect user input
with st.form(key='issue_form'):
url = st.text_input("URL")
author = st.text_input("Author")
description = st.text_area("Description")
license = st.text_input("License")
tags = st.text_input("Tags (comma-separated)")
types = st.text_input("Type(s) (comma-separated)")
submit_button = st.form_submit_button(label='Submit')

# Handle form submission
if submit_button:
# Create GitHub issue
issue_title = f"Issue submitted by {author}"
issue_body = (
f"URL: {url}\n\n"
f"Description: {description}\n\n"
f"License: {license}\n\n"
f"Tags: {tags}\n\n"
f"Type(s): {types}"
)
try:
issue = repo.create_issue(title=issue_title, body=issue_body)
st.success(f"Issue created: {issue.html_url}")
except Exception as e:
st.error(f"Failed to create issue: {e}")

# cd ..\scripts
# streamlit run appsubmitter.py
Loading