diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index e2b7dd5..d3a8d03 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -113,37 +113,81 @@ jobs: echo "avatar_rows_file=$avatar_rows_file" >> "$GITHUB_OUTPUT" echo "total_valid_entries=$total_valid_entries" >> "$GITHUB_OUTPUT" - - name: Update README with user skins - id: update_readme - shell: bash - run: | - 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" +- name: Update README with user skins + id: update_readme + shell: bash + run: | + set -eo pipefail - if [ "$total_valid_entries" -eq 0 ]; then - echo "No valid entries found, skipping README update" - exit 0 - fi + 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" - cp "$README_PATH" "${README_PATH}.bak" + if [ "$total_valid_entries" -eq 0 ]; then + echo "No valid entries found – skipping README update" + exit 0 + fi - cat > "$README_PATH" <<-EOF - # osu! Swiss Community Skin collection - ... - EOF + # Backup the old README + cp "$README_PATH" "${README_PATH}.bak" - # (append sorted entries to README like before) - ... + # Write the new README + cat > "$README_PATH" <<-EOF + # osu! Swiss Community Skin collection - # Check for change - if cmp -s "$README_PATH" "${README_PATH}.bak"; then - echo "README has not changed, skipping commit" - exit 0 - fi + Welcome to the osu! Swiss Community Skin collection, this repository archives and showcases Skins osc members use. - echo "README updated" + 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 + +
+ list instead of icons +
+ + + + + + + + + + + + EOF + + sort -t '|' -k1,1n "$user_rows_file" | cut -d'|' -f2- | sed 's/^/ /' >> "$README_PATH" + + cat >> "$README_PATH" <<-EOF + +
NameGlobal RankCountry RankProfileSkins
+
+ +

+ EOF + + sort -t '|' -k1,1n "$avatar_rows_file" | cut -d'|' -f2- | sed 's/^/ /' >> "$README_PATH" + + cat >> "$README_PATH" <<-EOF +

+ 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 + else + echo "README updated" + fi - name: Configure Git run: |