name: Update | Pipeline on: workflow_dispatch: jobs: parse-current-modpacks: name: Parse current modpacks to a list runs-on: ubuntu-latest permissions: contents: read outputs: modpack_folders: ${{ steps.list_modpacks.outputs.modpack_folders }} steps: - name: Check Out Git Repository uses: actions/checkout@v4 - name: List Modpacks id: list_modpacks run: | modpackFolders=() for folder in *; do if [ -d "$folder" ]; then if [ -e "$folder/pack.toml" ]; then modpackFolders+=("$folder") fi fi done echo "modpack_folders=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${modpackFolders[@]}")" >> "$GITHUB_OUTPUT" - name: Current detected modpacks run: | echo "::notice ::⚙ Current detected modpacks: ${{ steps.list_modpacks.outputs.modpack_folders }}" update_mods: name: Update Mods runs-on: ubuntu-latest needs: - parse-current-modpacks if: ${{ (needs.parse-current-modpacks.outputs.modpack_folders) != '[]' }} strategy: fail-fast: false matrix: modpack: ${{ fromJson(needs.parse-current-modpacks.outputs.modpack_folders) }} defaults: run: working-directory: ${{ matrix.modpack }} permissions: contents: write pull-requests: write steps: - name: Checkout Repository uses: actions/checkout@v4 - name: Install Packwiz uses: supplypike/setup-bin@v3 with: uri: 'https://nightly.link/packwiz/packwiz/workflows/go/main/Linux%2064-bit%20x86.zip' name: 'packwiz' version: 'linux' - name: Update Mods with Packwiz run: packwiz update -a -y - name: Push the updated mod list via a Pull Request uses: peter-evans/create-pull-request@v6 with: commit-message: "update(${{ matrix.modpack }}): updated mods" title: 'update(${{ matrix.modpack }}): updated mods' body: > This PR is auto-generated by [create-pull-request](https://github.com/peter-evans/create-pull-request).