Skip to content

Commit

Permalink
small change
Browse files Browse the repository at this point in the history
  • Loading branch information
vrunda2005 committed Dec 26, 2024
1 parent b1f741e commit 48d4d28
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/contributors_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,20 @@ jobs:
"https://api.github.com/repos/${REPO_NAME}/contributors?per_page=10" | \
jq -r '.[] | "- [@\(.login)](https://github.com/\(.login))"')
# Ensure contributors were fetched
if [ -z "$CONTRIBUTORS" ]; then
echo "No contributors found. Exiting."
exit 1
fi
# Printing the fetched contributors for debugging
# Print the fetched contributors for debugging
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')
# new contributors section
# Prepare new contributors section
CONTRIBUTORS_SECTION="## 🎉 Big Thanks to Amazing Contributors\n\n"
CONTRIBUTORS_SECTION+="<p align=\"center\">\n"
CONTRIBUTORS_SECTION+=" <a href=\"https://github.com/${REPO_NAME}/graphs/contributors\">\n"
Expand All @@ -62,7 +63,7 @@ jobs:
echo "Updating README with the following content:"
echo -e "$CONTRIBUTORS_SECTION"
# Useing awk to insert the new contributors section
# Use awk to insert the new contributors section
awk -v block="$CONTRIBUTORS_SECTION" '
BEGIN { start = 0 }
/## 🎉 Big Thanks to Amazing Contributors/ { start = 1; print block; next }
Expand Down

0 comments on commit 48d4d28

Please sign in to comment.