GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ci: fix format · tweet/opencode@eb4afdc

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • format.yml
  • script
    • format.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/format.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/format.yml
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
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
@@ -28,3 +27,5 @@ jobs:
2827
./script/format.ts
2928
env:
3029
CI: true
30+
GITHUB_HEAD_REF: ${{ github.head_ref }}
31+
GITHUB_REF_NAME: ${{ github.ref_name }}
Collapse file

‎script/format.ts‎

Copy file name to clipboardExpand all lines: script/format.ts
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ 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"]
89
await $`git config --local user.email "[email protected]"`
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
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.