-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.2 KB
/
sort-modrinth-files.yml
File metadata and controls
45 lines (38 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Sort Modrinth Files
on:
push:
paths:
- '**/modrinth.index.json'
permissions:
contents: write
jobs:
sort-files:
runs-on: ubuntu-latest
if: github.actor != 'github-actions[bot]'
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
- name: Sort modrinth.index.json files
run: |
# Find all modrinth.index.json files and sort them
find . -name "modrinth.index.json" -type f | while read file; do
echo "Sorting $file"
node sort-modrinth-files.js "$file"
done
- name: Commit and push changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add "**/modrinth.index.json"
if ! git diff --staged --quiet; then
git commit -m "chore: sort modrinth.index.json files alphabetically"
git push
else
echo "No changes to commit"
fi