Skip to content

Commit d8401e1

Browse files
committed
ci: fix fmt
1 parent 55d6fcc commit d8401e1

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

.github/workflows/format.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
uses: actions/checkout@v4
1919
with:
2020
token: ${{ secrets.GITHUB_TOKEN }}
21+
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
22+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
2123

2224
- name: Setup Bun
2325
uses: ./.github/actions/setup-bun
@@ -27,5 +29,3 @@ jobs:
2729
./script/format.ts
2830
env:
2931
CI: true
30-
GITHUB_HEAD_REF: ${{ github.head_ref }}
31-
GITHUB_REF_NAME: ${{ github.ref_name }}

script/format.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ import { $ } from "bun"
55
await $`bun run prettier --ignore-unknown --write .`
66

77
if (process.env["CI"] && (await $`git status --porcelain`.text())) {
8-
const branch = process.env["GITHUB_HEAD_REF"] || process.env["GITHUB_REF_NAME"]
98
await $`git config --local user.email "[email protected]"`
109
await $`git config --local user.name "GitHub Action"`
1110
await $`git add -A`
1211
await $`git commit -m "chore: format code"`
13-
await $`git push origin HEAD:${branch} --no-verify`
12+
await $`git push --no-verify`
1413
}

0 commit comments

Comments
 (0)