GeezerVison is showing github.com — ci: fix fmt · nocksock/opencode@076c8b2
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/format.yml +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
19 | 19 | with: |
20 | 20 | token: ${{ secrets.GITHUB_TOKEN }} |
21 | 21 | repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} |
22 | | - ref: ${{ github.event.pull_request.head.sha || github.sha }} |
| 22 | + ref: ${{ github.event.pull_request.head.ref || github.ref_name }} |
23 | 23 |
|
24 | 24 | - name: Setup Bun |
25 | 25 | uses: ./.github/actions/setup-bun |
|
29 | 29 | ./script/format.ts |
30 | 30 | env: |
31 | 31 | CI: true |
| 32 | + PUSH_BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }} |
Collapse file
Copy file name to clipboardExpand all lines: script/format.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -9,5 +9,6 @@ if (process.env["CI"] && (await $`git status --porcelain`.text())) { |
9 | 9 | await $`git config --local user.name "GitHub Action"` |
10 | 10 | await $`git add -A` |
11 | 11 | await $`git commit -m "chore: format code"` |
12 | | - await $`git push --no-verify` |
| 12 | + const branch = process.env["PUSH_BRANCH"] |
| 13 | + await $`git push origin HEAD:${branch} --no-verify` |
13 | 14 | } |