name: sorting on: push: branches: [main] paths: - "_sprites/**" - "scripts/**" concurrency: group: sorting-${{ github.ref }} cancel-in-progress: true permissions: contents: write jobs: run-scripts: if: github.actor != 'github-actions[bot]' runs-on: ubuntu-latest steps: - name: checkout uses: actions/checkout@v4 - name: setup node + npm cache uses: actions/setup-node@v6 with: node-version: "20" cache: "npm" cache-dependency-path: ./package-lock.json - name: npm ci working-directory: ./scripts run: npm ci --no-audit --no-fund - name: setup python + pip cache uses: actions/setup-python@v6 with: python-version: "3.13" cache: "pip" cache-dependency-path: ./requirements.txt - name: install python deps working-directory: ./scripts run: pip install -r requirements.txt - name: scripts working-directory: ./scripts run: | rm -rf ../_sprites/unready npx tsx write.ts npx tsx sort.ts npx tsx unready.ts - name: commit changes (exclude sorted) run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git add -A . git reset _sprites/sorted git reset _sprites/sorted-merged git commit -m "actions commit" || exit 0 git push - name: upload sorted uses: actions/upload-artifact@v4 with: name: sorted path: ./_sprites/sorted retention-days: 15 compression-level: 0 - name: upload sorted-merged uses: actions/upload-artifact@v4 with: name: sorted-merged path: ./_sprites/sorted-merged retention-days: 15 compression-level: 0 - name: remove temp sorted folder run: | rm -rf ./_sprites/sorted rm -rf ./_sprites/sorted-merged