diff options
| author | seth <[email protected]> | 2023-02-08 22:20:52 +0000 |
|---|---|---|
| committer | seth <[email protected]> | 2023-02-08 17:21:16 -0500 |
| commit | 02bdb7bac444f0570fe68876317cdfe3ee815c78 (patch) | |
| tree | ce539553a8036aae34c9dbf398cfb1b9194af2d4 | |
| parent | 3b9df410bdfb06b49cafea41868fb57897cff0d5 (diff) | |
feat: auto-update mods
| -rw-r--r-- | .github/workflows/update-mods.yml | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/.github/workflows/update-mods.yml b/.github/workflows/update-mods.yml new file mode 100644 index 0000000..9b6ef42 --- /dev/null +++ b/.github/workflows/update-mods.yml @@ -0,0 +1,32 @@ +name: Update mods +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * *' +jobs: + update-mods: + runs-on: ubuntu-latest + steps: + - name: get packwiz + run: | + curl -fsSLo ~/packwiz.zip https://nightly.link/packwiz/packwiz/workflows/go/main/Linux%2064-bit%20x86.zip + unzip -d ~ ~/packwiz.zip + chmod 755 ~/packwiz + - uses: actions/[email protected] + - name: update mods + run: | + echo "y" | ~/packwiz update --all + - name: check for changes + id: git-check + run: | + echo ::set-output name=modified::$(if git status --porcelain | grep -E 'pack.toml|index.toml|mods\/' > /dev/null; then echo "true"; else echo "false"; fi) + - name: commit updates + if: steps.git-check.outputs.modified == 'true' + run: | + git config --global user.name 'github-actions' + git config --global user.email '[email protected]' + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} + + git add mods/ index.toml pack.toml + + git commit -m "chore: update mods" |
