name: "Modlist update"
on: push
jobs:
  update:
    runs-on: minecraft
    steps:
      - name: "grabbing new mods"
        uses: actions/checkout@v4

      - name: "unzip mods"
        shell: bash
        run: |
          unzip unzip_me.zip

      - name: "truncate readme"
        shell: bash
        run: |
          sed -i 's/MODS:.*/MODS:/' README.md
          cat README.md
          echo "$(ls --format=single-column *.jar)" >> README.md
          cat README.md
          git config user.name "${{ vars.WORKFLOW_USERNAME }}"
          git config user.email "${{ vars.WORKFLOW_EMAIL }}"
          git add README.md
          git commit -m "[AUTO] README update"
          git push origin HEAD
