From 3239640df465bb7fc01314dbdfe3b831a639e603 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 12 Jun 2026 11:41:08 +0800 Subject: [PATCH] ci: fix dubious ownership error on self-hosted runners (#106) Add safe.directory '*' to git config before running git operations. Self-hosted runners may run jobs under a different OS user than the one that owns the workspace, causing git to refuse operations with a 'dubious ownership' error. --- .github/workflows/ocr-review.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ocr-review.yml b/.github/workflows/ocr-review.yml index 4cbfe01..6c0806d 100644 --- a/.github/workflows/ocr-review.yml +++ b/.github/workflows/ocr-review.yml @@ -45,6 +45,9 @@ jobs: fetch-depth: 0 # Full history needed for merge-base diff ref: ${{ github.event.pull_request.head.sha }} + - name: Mark repository as safe directory + run: git config --global --add safe.directory '*' + - name: Fetch PR head ref (ensures fork commits are available) run: git fetch origin pull/${{ github.event.pull_request.number }}/head