File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1818 uses : actions/checkout@v4
1919 with :
2020 token : ${{ secrets.GITHUB_TOKEN }}
21- ref : ${{ github.head_ref || github.ref }}
2221
2322 - name : Setup Bun
2423 uses : ./.github/actions/setup-bun
2827 ./script/format.ts
2928 env :
3029 CI : true
30+ GITHUB_HEAD_REF : ${{ github.head_ref }}
31+ GITHUB_REF_NAME : ${{ github.ref_name }}
Original file line number Diff line number Diff line change @@ -5,9 +5,10 @@ import { $ } from "bun"
55await $ `bun run prettier --ignore-unknown --write .`
66
77if ( process . env [ "CI" ] && ( await $ `git status --porcelain` . text ( ) ) ) {
8+ const branch = process . env [ "GITHUB_HEAD_REF" ] || process . env [ "GITHUB_REF_NAME" ]
89 await $ `git config --local user.email "action@github.com"`
910 await $ `git config --local user.name "GitHub Action"`
1011 await $ `git add -A`
1112 await $ `git commit -m "chore: format code"`
12- await $ `git push --no-verify`
13+ await $ `git push origin HEAD: ${ branch } --no-verify`
1314}
You can’t perform that action at this time.
0 commit comments