-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
3,147 additions
and
2,441 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import os | ||
import github | ||
from github import Github | ||
|
||
# Helper function to recursively build the repo structure and include file extensions | ||
def get_repo_structure(path='.', prefix=''): | ||
structure = [] | ||
try: | ||
items = sorted(os.listdir(path)) | ||
except FileNotFoundError: | ||
print(f"Path not found: {path}") | ||
return structure | ||
|
||
for i, item in enumerate(items): | ||
if item.startswith('.'): | ||
continue # Skip hidden files and directories | ||
item_path = os.path.join(path, item) | ||
is_last = i == len(items) - 1 | ||
current_prefix = '└── ' if is_last else '├── ' | ||
|
||
if os.path.isdir(item_path): | ||
# Directory case | ||
structure.append(f"{prefix}{current_prefix}{item}/") | ||
next_prefix = prefix + (' ' if is_last else '│ ') | ||
structure.extend(get_repo_structure(item_path, next_prefix)) | ||
else: | ||
# File case with extension | ||
file_name, file_extension = os.path.splitext(item) | ||
structure.append(f"{prefix}{current_prefix}{file_name}{file_extension}") | ||
|
||
return structure | ||
|
||
# Function to update the repo_structure.txt file | ||
def update_structure_file(structure): | ||
try: | ||
with open('Documentation/repo_structure.txt', 'w') as f: | ||
f.write('\n'.join(structure)) | ||
print("repo_structure.txt updated successfully.") | ||
except IOError as e: | ||
print(f"Error writing to repo_structure.txt: {e}") | ||
|
||
# Function to update the README.md with the new structure | ||
def update_README(structure): | ||
try: | ||
with open('Documentation/PROJECT_STRUCTURE.md', 'r') as f: | ||
content = f.read() | ||
except FileNotFoundError: | ||
print("PROJECT_STRUCTURE.md not found.") | ||
return | ||
|
||
start_marker = '<!-- START_STRUCTURE -->' | ||
end_marker = '<!-- END_STRUCTURE -->' | ||
|
||
start_index = content.find(start_marker) | ||
end_index = content.find(end_marker) | ||
|
||
if start_index != -1 and end_index != -1: | ||
new_content = ( | ||
content[:start_index + len(start_marker)] + | ||
'\n```\n' + '\n'.join(structure) + '\n```\n' + | ||
content[end_index:] | ||
) | ||
try: | ||
with open('Documentation/PROJECT_STRUCTURE.md', 'w') as f: | ||
f.write(new_content) | ||
print("PROJECT_STRUCTURE.md updated with new structure.") | ||
except IOError as e: | ||
print(f"Error writing to PROJECT_STRUCTURE.md: {e}") | ||
else: | ||
print("Markers not found in PROJECT_STRUCTURE.md. Structure not updated.") | ||
|
||
# Main function to compare and update repository structure | ||
def main(): | ||
gh_token = os.getenv('GH_TOKEN') | ||
gh_repo = os.getenv('GITHUB_REPOSITORY') | ||
|
||
if not gh_token or not gh_repo: | ||
print("Environment variables GH_TOKEN and GITHUB_REPOSITORY must be set.") | ||
return | ||
|
||
g = Github(gh_token) | ||
repo = g.get_repo(gh_repo) | ||
|
||
current_structure = get_repo_structure() | ||
|
||
try: | ||
# Fetch the contents of repo_structure.txt from GitHub | ||
contents = repo.get_contents("Documentation/repo_structure.txt") | ||
existing_structure = contents.decoded_content.decode().split('\n') | ||
except github.GithubException: | ||
existing_structure = None | ||
|
||
if current_structure != existing_structure: | ||
update_structure_file(current_structure) | ||
update_README(current_structure) | ||
print("Repository structure updated.") | ||
else: | ||
print("No changes in repository structure.") | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Update Repository structure | ||
|
||
on: | ||
schedule: | ||
- cron: '0 * * * *' # Run every hour | ||
workflow_dispatch: # Allow manual triggering | ||
push: | ||
branches: | ||
- main # Updates repository when changes pushed into main branch | ||
|
||
jobs: | ||
detect-and-update-structure: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # Permission to the GitHub Bot to access and update the Project Repository | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.12 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install PyGithub | ||
- name: Run update script | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: python .github/scripts/update_structure.py # Run the python script to create/update the repo sturcture | ||
|
||
- name: Commit and push if changed # Commit and push changes to the head branch(main) | ||
run: | | ||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config user.name "github-actions[bot]" | ||
git add . | ||
git diff --quiet && git diff --staged --quiet || (git commit -m "Update repo structure" && git push) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Page Not Found :(</title> | ||
<link rel="stylesheet" href="website/styles/404.css"> | ||
<link rel="shortcut icon" href="website/web_images/3dlogo.svg" type="image/x-icon"> | ||
</head> | ||
<body> | ||
<div class="error404">4<img class="logo" src="website/web_images/2dglow.png" alt="Dataverese's Logo">4</div> | ||
<div class="info">Oops! Page not found.</div> | ||
<div class="info" id="detail">We couldn't find the page you requested. It might be unavailable at the moment or have a different URL.</div> | ||
<a href="index.html" class="home">Return to Home</a> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<h1 align="center">✨ Contributors Guide ✨</h1> | ||
<h3 align="center">Welcome to my DATAVERSE🌍 project! <br> We appreciate your interest in contributing.😊 <br>This guide will help you get started with the project and make your first contribution.</h3> | ||
|
||
![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif) | ||
--- | ||
|
||
# What you can contribute? 💭 | ||
|
||
|
@@ -14,44 +14,19 @@ Contributors can enhance the project by implementing new features or improvement | |
**📝 Documentation :** | ||
High-quality documentation is essential for the success of the project. Contributions to the documentation help ensure that users and contributors can understand and use the travel website effectively. | ||
|
||
![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif) | ||
--- | ||
|
||
# Code of Conduct | ||
|
||
Please read and follow our [Code of Conduct](https://github.com/multiverseweb/Dataverse/blob/main/code_of_conduct.md) | ||
|
||
![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif) | ||
--- | ||
|
||
# Project Structure 📂 | ||
|
||
```bash | ||
DATAVERSE/ | ||
├── .github/ # GitHub-related configurations such as workflows, issue templates, etc | ||
│ | ||
├── .vscode/ # Settings for the file project is included in this | ||
│ | ||
├── software/ # All the python related files are stored here | ||
│ | ||
├── website/ # The scripts and images for the project are stored here | ||
│ | ||
├── code_of_conduct.md # Some rules for the contributors | ||
│ | ||
├── Contributing.md # Instructions for the contribution | ||
│ | ||
├── index.html # Main file of the document that controls the structure of the project | ||
│ | ||
├── LICENSE # Authority for the project | ||
│ | ||
├── login.html # Login page in the project | ||
│ | ||
├── README.md # Some basic instructions | ||
│ | ||
├── signup.html # Sign up page in the project | ||
├── | ||
├── styles.css # Stylesheets of the project | ||
``` | ||
[View Project Structure](Documentation/ProjectScrusture.md) | ||
|
||
![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif) | ||
--- | ||
|
||
# General Guidelines 🧾 | ||
|
||
|
@@ -75,7 +50,7 @@ DATAVERSE/ | |
- **Commit Message Format**: | ||
Use meaningful and descriptive commit messages. | ||
|
||
![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif) | ||
--- | ||
|
||
# How to Contribute ? 📈 | ||
|
||
|
@@ -91,7 +66,7 @@ DATAVERSE/ | |
|
||
Thank you for your contribution!! | ||
|
||
![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif) | ||
--- | ||
|
||
# First Pull Request ✨ | ||
|
||
|
@@ -141,7 +116,7 @@ git push -u origin <your_branch_name> | |
|
||
10. **Congratulations! 🎉 you've made your contribution** | ||
|
||
![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif) | ||
--- | ||
|
||
# Alternatively, contribute using GitHub Desktop 🖥️ | ||
|
||
|
@@ -177,14 +152,14 @@ git push -u origin <your_branch_name> | |
9. **Wait for Review:** | ||
Your pull request will now be available for review by the project maintainers. They may provide feedback or ask for changes before merging your pull request into the main branch of the project repository. | ||
|
||
![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif) | ||
--- | ||
|
||
# For Help And Support 💬 | ||
|
||
- Admin :- Tejas Gupta | ||
- Contact :- [Email]([email protected]) | ||
|
||
![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif) | ||
--- | ||
|
||
# Good Coding Practices 🧑💻 | ||
|
||
|
@@ -218,7 +193,7 @@ Your pull request will now be available for review by the project maintainers. T | |
- Conduct code reviews for others and provide meaningful suggestions to improve the code. | ||
- Always refactor your code based on feedback to meet the project's standards. | ||
|
||
![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif) | ||
--- | ||
|
||
# Pull Request Process 🚀 | ||
|
||
|
@@ -230,7 +205,7 @@ When submitting a pull request, please adhere to the following: | |
4. Add relevant screenshots to assist in the review process. | ||
5. Submit your PR using the provided template and hang tight; we'll review it as soon as possible! 🚀 | ||
|
||
![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif) | ||
--- | ||
|
||
# Issue Report Process 📌 | ||
|
||
|
@@ -241,18 +216,18 @@ To report an issue, follow these steps: | |
3. Wait until someone looks into your report. | ||
4. Begin working on the issue only after you have been assigned to it. 🚀 | ||
|
||
![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif) | ||
--- | ||
|
||
# Contribution Points | ||
|
||
*🏆 Contribution Levels:* | ||
All the tasks will be assigned various levels based on the complexity of the task and skills required to complete it. Every level will provide you a different amount of Points that is: | ||
|
||
- **🥇 Level 1**: 10 Points | ||
- **🥈 Level 2**: 25 Points | ||
- **🥉 Level 3**: 45 Points | ||
- **`🥇 Level 1`**: 10 Points | ||
- **`🥈 Level 2`**: 25 Points | ||
- **`🥉 Level 3`**: 45 Points | ||
|
||
![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif) | ||
--- | ||
|
||
|
||
<h2 align="center">Need more help? 🤔</h1> | ||
|
@@ -265,13 +240,13 @@ All the tasks will be assigned various levels based on the complexity of the tas | |
<a href="https://docs.github.com/get-started">Getting started with Git and GitHub</a> <br> | ||
</p> | ||
|
||
![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif) | ||
--- | ||
|
||
# Thank you for contributing 💗 | ||
|
||
We truly appreciate your time and effort to help improve our project. Feel free to reach out if you have any questions or need guidance. Happy coding! 🚀 | ||
|
||
![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif) | ||
--- | ||
|
||
<h2 align="center">Tip from us 😇</h1> | ||
<p align="center">It always takes time to understand and learn. So, don't worry at all. We know <b>you have got this</b>! 💪</p> | ||
|
Oops, something went wrong.