Skip to content

Commit a926ebc

Browse files
committed
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)
1 parent c4186bc commit a926ebc

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@ jobs:
4848
build:
4949
runs-on: ubuntu-latest
5050
needs: [test, typecheck]
51+
permissions:
52+
contents: write
5153
steps:
5254
- uses: actions/checkout@v4
55+
with:
56+
token: ${{ secrets.GITHUB_TOKEN }}
5357

5458
- uses: oven-sh/setup-bun@v2
5559
with:
@@ -68,6 +72,19 @@ jobs:
6872
test -f dist/index.js || (echo "ERROR: dist/index.js not found!" && exit 1)
6973
test -f dist/index.d.ts || (echo "ERROR: dist/index.d.ts not found!" && exit 1)
7074
75+
- name: Auto-commit schema changes
76+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
77+
run: |
78+
if git diff --quiet assets/oh-my-opencode.schema.json; then
79+
echo "No schema changes to commit"
80+
else
81+
git config user.name "github-actions[bot]"
82+
git config user.email "github-actions[bot]@users.noreply.github.com"
83+
git add assets/oh-my-opencode.schema.json
84+
git commit -m "chore: auto-update schema.json"
85+
git push
86+
fi
87+
7188
draft-release:
7289
runs-on: ubuntu-latest
7390
needs: [build]

0 commit comments

Comments
 (0)