Add update-wit workflow

This commit is contained in:
Demetrius Kanios 2026-08-03 17:49:08 -07:00
parent d4fb356cb7
commit 7ed409b5af
2 changed files with 45 additions and 4 deletions

View File

@ -1,11 +1,13 @@
name: Main name: Main
on: on:
push: push:
branches: pull_request:
- "*"
tags:
- "v*"
workflow_dispatch: workflow_dispatch:
workflow_run:
types:
- completed
workflows:
- "Update WIT"
permissions: permissions:
contents: write contents: write

39
.github/workflows/update-wit.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: Update WIT
on:
workflow_dispatch:
permissions:
contents: write
jobs:
update-wit:
name: Update WIT
runs-on: ubuntu-slim
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