Skip to content

Commit

Permalink
new test5
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhagarwal1 committed Oct 5, 2024
1 parent 79badde commit 68fa762
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/update-contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,16 @@ jobs:
# Create a temporary file to hold the new README content
temp_file=$(mktemp)
# Read the existing README content and manage contributors
# Read the existing README content
contributor_found=false
while IFS= read -r line; do
echo "$line" >> "$temp_file"
# Check for the Contributors section
if [[ "$line" == "## Contributors" ]]; then
contributor_found=true
# Skip existing contributors
echo "" >> "$temp_file" # Add a blank line before new contributors
fi
# If we find the end of the Contributors section, we break the loop
if [[ "$contributor_found" == true && "$line" == ##* ]]; then
break
fi
done < README.md
# Append new unique contributors only if they are not already in the existing list
Expand All @@ -52,16 +47,11 @@ jobs:
fi
done <<< "${{ env.contributors }}"
# If the Contributors section was found, add the end comment (if needed)
# If the Contributors section was found, close it properly
if [ "$contributor_found" = true ]; then
echo "## End of Contributors" >> "$temp_file" # You can customize this closing comment
fi
# Append the rest of the README content (if necessary)
while IFS= read -r line; do
echo "$line" >> "$temp_file"
done < <(tail -n +$(( $(grep -n "## Contributors" README.md | cut -d: -f1) + 1 )) README.md)
# Move the temp file to the original README
mv "$temp_file" README.md
Expand Down

0 comments on commit 68fa762

Please sign in to comment.