From 88a44459afeb3f0e5f3da78b9acbc721cb8099dc Mon Sep 17 00:00:00 2001 From: Vamsi Krishna Kolli <11007620+vamc-k@users.noreply.github.com> Date: Wed, 22 May 2024 11:01:16 +0530 Subject: [PATCH] Add workflow to update contributors list in README.md (#30) * add workflow to update contributors list in README.md * Update contributors * Updated workflow to trigger only if commits to main * Add check to skip commit if no changes --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/workflows/update-contributors.yml | 38 ++++++++++++++++ README.md | 21 +++++++++ update_contributors.py | 54 +++++++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 .github/workflows/update-contributors.yml create mode 100644 update_contributors.py diff --git a/.github/workflows/update-contributors.yml b/.github/workflows/update-contributors.yml new file mode 100644 index 0000000..4d6fd5c --- /dev/null +++ b/.github/workflows/update-contributors.yml @@ -0,0 +1,38 @@ +name: Update Contributors + +on: + push: + branches: + - main + workflow_dispatch: # Allows manual trigger of the workflow + +jobs: + update-contributors: + 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.10' + + - name: Install dependencies + run: pip install requests + + - name: Update README.md with contributors + run: python update_contributors.py + + - name: Check for changes and commit + run: | + if git diff --quiet; then + echo "No changes to commit"; + else + git config --global user.name 'github-actions[bot]' + git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' + git add README.md + git commit -m 'Update contributors' + git push + fi diff --git a/README.md b/README.md index b25ad65..300af94 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,24 @@ npx @11ty/eleventy --serve --port=8080 ## License [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](LICENSE.md) + +## Contributors + + +
Bharat Saraswat |
+ Ani |
+ Ayush Jain |
+ Techiezy |
+ Subroto Banerjee |
+ Vamsi Krishna Kolli |
+
Priyanshu |
+ Abhishek |
+ Aditi Juneja |
+ Praveen (Gnovi) |
+
{name} | """
+
+ if (i + 1) % rows_per_column == 0:
+ new_contributors_section += "\n