Skip to content

Commit a8145d6

Browse files
committed
fix: gnu-tar
1 parent 40f86af commit a8145d6

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/pages.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,23 @@ jobs:
4141
- name: Checkout
4242
uses: actions/checkout@v4
4343

44+
# actions/upload-pages-artifact@v3 显式调用 `gtar`(GNU tar),macOS 默认只有 BSD `tar`,
45+
# 这里把 Homebrew 路径写进 GITHUB_PATH 并校验 `gtar` 存在。
46+
# 首次部署前请在这台 self-hosted runner 上执行: brew install gnu-tar
47+
- name: Ensure GNU tar on PATH (macOS self-hosted)
48+
if: runner.os == 'macOS'
49+
shell: bash
50+
run: |
51+
for p in /opt/homebrew/bin /usr/local/bin; do
52+
[ -x "$p/gtar" ] && echo "$p" >> "$GITHUB_PATH"
53+
done
54+
export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
55+
if ! command -v gtar >/dev/null; then
56+
echo "::error::gtar not found. Run once on the runner host: brew install gnu-tar"
57+
exit 1
58+
fi
59+
gtar --version | head -n 1
60+
4461
- name: Setup Node
4562
uses: actions/setup-node@v4
4663
with:

0 commit comments

Comments
 (0)