fix(ci): use --replace-all for git safe.directory to prevent self-hosted runner failure
Some checks are pending
CI / test (push) Waiting to run

On self-hosted runners, _github_home/.gitconfig persists across jobs.
The ocr-review workflow used --add which accumulated multiple safe.directory
values over time. Once multiple values existed, other workflows using plain
git config (without --add/--replace-all) failed with "cannot overwrite
multiple values with a single value".

Unify all workflows to use --replace-all, which clears previous values and
writes exactly one entry regardless of prior state.
This commit is contained in:
kite 2026-06-29 11:37:23 +08:00
parent 0d601eaf58
commit 0881ad87b8
4 changed files with 6 additions and 6 deletions

View file

@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v4
- name: Trust workspace
run: git config --global safe.directory '*'
run: git config --global --replace-all safe.directory '*'
- name: Vet
run: go vet ./...

View file

@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v4
- name: Trust workspace
run: git config --global safe.directory '*'
run: git config --global --replace-all safe.directory '*'
- name: Install dependencies
working-directory: pages

View file

@ -73,7 +73,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
- name: Mark repository as safe directory
run: git config --global --add safe.directory '*'
run: git config --global --replace-all safe.directory '*'
- name: Fetch PR head ref (ensures fork commits are available)
run: git fetch origin pull/${{ github.event.pull_request.number }}/head

View file

@ -31,7 +31,7 @@ jobs:
- uses: actions/checkout@v4
- name: Trust workspace
run: git config --global safe.directory '*'
run: git config --global --replace-all safe.directory '*'
- name: Build
env:
@ -73,7 +73,7 @@ jobs:
fetch-depth: 0
- name: Trust workspace
run: git config --global safe.directory '*'
run: git config --global --replace-all safe.directory '*'
- name: Generate release notes from commits
id: notes
@ -167,7 +167,7 @@ jobs:
- uses: actions/checkout@v4
- name: Trust workspace
run: git config --global safe.directory '*'
run: git config --global --replace-all safe.directory '*'
- name: Install jq
run: apt-get update && apt-get install -y jq