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:
17
.github/workflows/ci.yml
vendored
17
.github/workflows/ci.yml
vendored
@@ -48,8 +48,12 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test, typecheck]
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
@@ -68,6 +72,19 @@ jobs:
|
||||
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)
|
||||
|
||||
- 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:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build]
|
||||
|
||||
Reference in New Issue
Block a user