feat(ci): auto-commit schema.json changes on master push

- Automatically commits schema changes generated by build step
- Runs only on master branch push events
- Uses github-actions bot account for commits
- Reduces manual schema update commits

🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2025-12-20 12:50:02 +09:00
parent c4186bcca2
commit a926ebcf8c

View File

@@ -48,8 +48,12 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [test, typecheck] needs: [test, typecheck]
permissions:
contents: write
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: oven-sh/setup-bun@v2 - uses: oven-sh/setup-bun@v2
with: with:
@@ -68,6 +72,19 @@ jobs:
test -f dist/index.js || (echo "ERROR: dist/index.js not found!" && exit 1) test -f dist/index.js || (echo "ERROR: dist/index.js not found!" && exit 1)
test -f dist/index.d.ts || (echo "ERROR: dist/index.d.ts not found!" && exit 1) test -f dist/index.d.ts || (echo "ERROR: dist/index.d.ts not found!" && exit 1)
- name: Auto-commit schema changes
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
if git diff --quiet assets/oh-my-opencode.schema.json; then
echo "No schema changes to commit"
else
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add assets/oh-my-opencode.schema.json
git commit -m "chore: auto-update schema.json"
git push
fi
draft-release: draft-release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build] needs: [build]