From e661e4de6af733870f3c7ec642794fcc3658be05 Mon Sep 17 00:00:00 2001 From: Demetrius Kanios Date: Mon, 3 Aug 2026 16:04:07 -0700 Subject: [PATCH] Add `update-wit` workflow --- .github/workflows/release.yml | 3 +++ .github/workflows/update-wit.yml | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/update-wit.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a3043e0..caf4186 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,9 @@ name: Release on: push: workflow_dispatch: + workflow_run: + workflows: ["Update WIT"] + types: [completed] permissions: contents: write diff --git a/.github/workflows/update-wit.yml b/.github/workflows/update-wit.yml new file mode 100644 index 0000000..49640ca --- /dev/null +++ b/.github/workflows/update-wit.yml @@ -0,0 +1,39 @@ +name: Update WIT +on: + workflow_dispatch: + +permissions: + contents: write + +jobs: + update-wit: + name: Update WIT + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + submodules: true + - name: Update submodule + id: update_submodule + run: | + set -eux + + cd wit + git fetch origin master + git checkout FETCH_HEAD + + echo "wit_commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Commit + run: | + set -eux + + witCommit='${{ steps.update_submodule.outputs.wit_commit }}' + + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + git add wit + git commit -m "Sync to Pumpkin-MC/pumpkin-plugin-wit@${witCommit}" + git push