Skip to content

Commit

Permalink
Run packwiz refresh *after* processing the commit
Browse files Browse the repository at this point in the history
  • Loading branch information
OoLunar committed Oct 21, 2023
1 parent 719eb10 commit f9a3cc7
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions .github/scripts/process-commit.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
#!/bin/bash
set -x

# Run Packwiz Refresh
~/go/bin/packwiz refresh

# Check if there are any changes
git diff-index --quiet HEAD
if [ "$?" == "1" ]; then
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add . > /dev/null
git commit -m "\`packwiz refresh\`." > /dev/null
git push > /dev/null
fi

# Check if any new mods, resourcepacks or shaderpacks were added. If so, we're bumping the semver minor version up by one
new_semver=""
Expand All @@ -28,6 +14,19 @@ elif [ ! -z "${modified_files[@]}" ]; then
new_semver="$(echo $current_semver | awk -F. -v OFS=. '{$NF++; print}')"
fi

# Run Packwiz Refresh
~/go/bin/packwiz refresh

# Check if there are any changes
git diff-index --quiet HEAD
if [ "$?" == "1" ]; then
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add . > /dev/null
git commit -m "\`packwiz refresh\`." > /dev/null
git push > /dev/null
fi

# Modify the pack.toml file
if [ ! -z "$new_semver" ]; then
sed -i "s/version = \"$current_semver\"/version = \"$new_semver\"/g" pack.toml
Expand Down

0 comments on commit f9a3cc7

Please sign in to comment.