Update .gitea/workflows/ci.yml
This commit is contained in:
@@ -117,33 +117,77 @@ jobs:
|
||||
id: update_readme
|
||||
shell: bash
|
||||
run: |
|
||||
set -eo pipefail
|
||||
|
||||
user_rows_file="${{ steps.find_skins.outputs.user_rows_file }}"
|
||||
avatar_rows_file="${{ steps.find_skins.outputs.avatar_rows_file }}"
|
||||
total_valid_entries="${{ steps.find_skins.outputs.total_valid_entries }}"
|
||||
README_PATH="README.md"
|
||||
|
||||
if [ "$total_valid_entries" -eq 0 ]; then
|
||||
echo "No valid entries found, skipping README update"
|
||||
echo "No valid entries found – skipping README update"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Backup the old README
|
||||
cp "$README_PATH" "${README_PATH}.bak"
|
||||
|
||||
# Write the new README
|
||||
cat > "$README_PATH" <<-EOF
|
||||
# osu! Swiss Community Skin collection
|
||||
...
|
||||
|
||||
Welcome to the osu! Swiss Community Skin collection, this repository archives and showcases Skins osc members use.
|
||||
|
||||
Enjoy looking around, click file names to download the skins and click on the images to see more about the skins.
|
||||
|
||||
## How do I add my skins here?
|
||||
|
||||
If you're interested in adding your skins here please follow this tutorial [how-to-use](/how-to-use.md)
|
||||
|
||||
## Skins
|
||||
|
||||
<details>
|
||||
<summary>list instead of icons</summary>
|
||||
<br />
|
||||
<table border="1" cellpadding="5" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Global Rank</th>
|
||||
<th>Country Rank</th>
|
||||
<th>Profile</th>
|
||||
<th>Skins</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
EOF
|
||||
|
||||
# (append sorted entries to README like before)
|
||||
...
|
||||
sort -t '|' -k1,1n "$user_rows_file" | cut -d'|' -f2- | sed 's/^/ /' >> "$README_PATH"
|
||||
|
||||
# Check for change
|
||||
cat >> "$README_PATH" <<-EOF
|
||||
</tbody>
|
||||
</table>
|
||||
</details>
|
||||
|
||||
<p align="center">
|
||||
EOF
|
||||
|
||||
sort -t '|' -k1,1n "$avatar_rows_file" | cut -d'|' -f2- | sed 's/^/ /' >> "$README_PATH"
|
||||
|
||||
cat >> "$README_PATH" <<-EOF
|
||||
</p>
|
||||
EOF
|
||||
|
||||
# Clean up temp files
|
||||
rm -f "$user_rows_file" "$avatar_rows_file"
|
||||
|
||||
# Check for differences to avoid unnecessary commit
|
||||
if cmp -s "$README_PATH" "${README_PATH}.bak"; then
|
||||
echo "README has not changed, skipping commit"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
else
|
||||
echo "README updated"
|
||||
fi
|
||||
|
||||
- name: Configure Git
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user