ci: fix fmt

This commit is contained in:
Aiden Cline 2025-12-07 20:28:50 -06:00
parent 55d6fcc350
commit d8401e1937
2 changed files with 3 additions and 4 deletions

View file

@ -18,6 +18,8 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Setup Bun
uses: ./.github/actions/setup-bun
@ -27,5 +29,3 @@ jobs:
./script/format.ts
env:
CI: true
GITHUB_HEAD_REF: ${{ github.head_ref }}
GITHUB_REF_NAME: ${{ github.ref_name }}

View file

@ -5,10 +5,9 @@ import { $ } from "bun"
await $`bun run prettier --ignore-unknown --write .`
if (process.env["CI"] && (await $`git status --porcelain`.text())) {
const branch = process.env["GITHUB_HEAD_REF"] || process.env["GITHUB_REF_NAME"]
await $`git config --local user.email "action@github.com"`
await $`git config --local user.name "GitHub Action"`
await $`git add -A`
await $`git commit -m "chore: format code"`
await $`git push origin HEAD:${branch} --no-verify`
await $`git push --no-verify`
}