File tree Expand file tree Collapse file tree 3 files changed +42
-1
lines changed
Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Format
2+
3+ on :
4+ push :
5+ pull_request :
6+ workflow_dispatch :
7+ jobs :
8+ format :
9+ runs-on : ubuntu-latest
10+ permissions :
11+ contents : write
12+ steps :
13+ - name : Checkout repository
14+ uses : actions/checkout@v4
15+ with :
16+ token : ${{ secrets.GITHUB_TOKEN }}
17+
18+ - name : Setup Bun
19+ uses : oven-sh/setup-bun@v1
20+ with :
21+ bun-version : 1.2.19
22+
23+ - name : Install dependencies
24+ run : bun install
25+
26+ - name : Run format
27+ run : bun run format
28+ env :
29+ CI : true
Original file line number Diff line number Diff line change 66 "packageManager" : " bun@1.2.19" ,
77 "scripts" : {
88 "dev" : " bun run --conditions=development packages/opencode/src/index.ts" ,
9- "format" : " bun run prettier --ignore-unknown --write $(git ls-files)" ,
109 "typecheck" : " bun run --filter='*' typecheck" ,
1110 "generate" : " (cd packages/sdk && ./js/script/generate.ts) && (cd packages/sdk/stainless && ./generate.ts)" ,
1211 "postinstall" : " ./script/hooks"
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env bun
2+
3+ import { $ } from "bun"
4+
5+ await $ `bun run prettier --ignore-unknown --write $(git ls-files)`
6+
7+ if ( process . env [ "CI" ] && ( await $ `git status --porcelain` . text ( ) ) ) {
8+ await $ `git config --local user.email "action@github.com"`
9+ await $ `git config --local user.name "GitHub Action"`
10+ await $ `git add -A`
11+ await $ `git commit -m "chore: format code"`
12+ await $ `git push`
13+ }
You can’t perform that action at this time.
0 commit comments