From 2384d5575d63f661a84250cca414072697187786 Mon Sep 17 00:00:00 2001 From: Vrunda Patel Date: Sat, 28 Dec 2024 01:49:08 +0530 Subject: [PATCH] changed --- .github/workflows/contributors_update.yml | 25 ++++++++--------------- README.md | 10 --------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/.github/workflows/contributors_update.yml b/.github/workflows/contributors_update.yml index f463df8..075482c 100644 --- a/.github/workflows/contributors_update.yml +++ b/.github/workflows/contributors_update.yml @@ -23,47 +23,38 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - # Manually specify the repository name + # repository name REPO_NAME="Programming-Club-Ahmedabad-University/WOC-2024" - # File to update README_PATH="README.md" - # Fetch contributors from GitHub API and format the output for display - CONTRIBUTORS=$(curl -H "Authorization: Bearer $GH_TOKEN" -s \ + # Fetch contributors + CONTRIBUTORS=$(curl -H "Authorization: Bearer $GH_TOKEN" -s \ "https://api.github.com/repos/${REPO_NAME}/contributors?per_page=10" | \ - jq -r '.[] | "- [@\(.login)](https://github.com/\(.login))"') + jq -r '.[] | "

\n \"avatar\"\n @\(.login)\n

"') + - # Ensure contributors were fetched if [ -z "$CONTRIBUTORS" ]; then echo "No contributors found. Exiting." exit 1 fi - # Print the fetched contributors for debugging + # Print the fetched contributors echo "Fetched Contributors:" echo "$CONTRIBUTORS" - # Get the current timestamp in IST LAST_UPDATED=$(TZ='Asia/Kolkata' date '+%Y-%m-%d %I:%M:%S %p IST') # Prepare new contributors section CONTRIBUTORS_SECTION="## 🎉 Big Thanks to Amazing Contributors\n\n" - CONTRIBUTORS_SECTION+="

\n" - CONTRIBUTORS_SECTION+=" \n" - CONTRIBUTORS_SECTION+=" \"Contributors\n" - CONTRIBUTORS_SECTION+=" \n" - CONTRIBUTORS_SECTION+="

\n\n" - - CONTRIBUTORS_SECTION+="### Top Contributors\n" CONTRIBUTORS_SECTION+="${CONTRIBUTORS}\n\n" - CONTRIBUTORS_SECTION+="

Last updated: ${LAST_UPDATED}

\n" + CONTRIBUTORS_SECTION+="

Last updated: ${LAST_UPDATED}

\n" # Debug the section before updating README echo "Updating README with the following content:" echo -e "$CONTRIBUTORS_SECTION" - # Use awk to insert the new contributors section + # Use awk to replace or append the new contributors section awk -v block="$CONTRIBUTORS_SECTION" ' BEGIN { start = 0 } /## 🎉 Big Thanks to Amazing Contributors/ { start = 1; print block; next } diff --git a/README.md b/README.md index 7a4645c..bfb5c47 100644 --- a/README.md +++ b/README.md @@ -60,16 +60,6 @@ Read our [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) to ensure a respectful and inc ## 🎉 Big Thanks to Amazing Contributors -

- - Contributors Group Image - -

- -### Top Contributors - - - ## 🆘 Need Help? - Head on to [Pclub Discord Server](https://discord.gg/xucxx98e) and ask for doubts or meet with maintainer