diff --git a/.github/workflows/update_contributors.yml b/.github/workflows/update_contributors.yml deleted file mode 100644 index c388888fc..000000000 --- a/.github/workflows/update_contributors.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Update Contributors - -on: - schedule: - - cron: '0 0 * * 1' # Runs every Monday at 00:00 - push: - branches: - - main - -jobs: - update-readme: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - - name: Install dependencies - run: pip install requests - - - name: Run update script - run: python update_contributors.py - - - name: Commit changes - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - git add README.md - git commit -m 'Update contributors list' - git push diff --git a/README.md b/README.md index 114e36bd6..b751dc2c7 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ We appreciate your interest in contributing. 💐 This guide will help you get s ```bash git clone https://github.com//30-Days-Of-CPP.git ``` - - If you have already forked the project, update your copy before working: + If you have already forked the project, update your copy before working: ```bash git remote update ``` @@ -35,7 +35,7 @@ We appreciate your interest in contributing. 💐 This guide will help you get s ```bash git remote add upstream https://github.com/subhadipbhowmik/30-Days-Of-CPP.git ``` - - If you have altered it, you have to rebase it: + If you have altered it, you have to rebase it: ```bash git rebase upstream/ ``` @@ -105,13 +105,6 @@ Happy coding! ![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif) -## Contributors List - -| Avatar | Name | GitHub Profile | -|--------|------|----------------| - - - ## License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. diff --git a/update_contributors.py b/update_contributors.py deleted file mode 100644 index 499618f1a..000000000 --- a/update_contributors.py +++ /dev/null @@ -1,36 +0,0 @@ -import requests - -username = 'subhadipbhowmik' -repo = '30-Days-Of-CPP' -url = f'https://api.github.com/repos/{username}/{repo}/contributors' - -response = requests.get(url) -contributors = response.json() - -contributors_list = [] - -for contributor in contributors: - avatar_url = contributor['avatar_url'] - login = contributor['login'] - profile_url = contributor['html_url'] - - contributors_list.append(f"| ![avatar]({avatar_url}&s=50) | [{login}]({profile_url}) |") - -with open('README.md', 'r') as file: - readme_content = file.readlines() - -# Find the index to insert contributors -start_index = readme_content.index('| Avatar | Name | GitHub Profile |\n') + 2 - -# Remove existing contributors data -while readme_content[start_index].startswith('| ![avatar]'): - readme_content.pop(start_index) - -# Insert new contributors data -for contributor in contributors_list: - readme_content.insert(start_index, f"{contributor}\n") - start_index += 1 - -# Write the updated content back to README.md -with open('README.md', 'w') as file: - file.writelines(readme_content)