generated from ParadigmMC/mc-modpack-kit
-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (60 loc) · 2.08 KB
/
update.yml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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 nix
uses: cachix/install-nix-action@v26
- name: Update Mods with Packwiz
run: nix develop --command 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).