fix: add git safe.directory for containerized CI with persistent cache

When using persistent cargo cache mounted from host directory, the container
user differs from the directory owner, causing git "dubious ownership" error.
This fix adds `git config --global --add safe.directory '*'` before cargo
commands in containerized jobs.
This commit is contained in:
2026-01-28 04:37:43 +03:00
parent 245f09fb7c
commit 2ff04aef55
3 changed files with 17 additions and 4 deletions
+8 -2
View File
@@ -38,8 +38,11 @@ jobs:
# Exclude pezkuwi-zombienet-sdk-tests: its build.rs runs nested cargo build
# which doesn't inherit workspace [patch.crates-io] settings, causing
# serde_core duplicate lang item error. See: https://github.com/pezkuwichain/pezkuwi-sdk/issues/357
- run: cargo test --doc --workspace --locked --all-features --exclude pezkuwi-zombienet-sdk-tests
- name: script
id: required
run: |
git config --global --add safe.directory '*'
cargo test --doc --workspace --locked --all-features --exclude pezkuwi-zombienet-sdk-tests
build-rustdoc:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
@@ -60,8 +63,11 @@ jobs:
# Exclude pezkuwi-zombienet-sdk-tests: nested cargo build in build.rs
# doesn't inherit workspace patches. See test-doc job comment.
- run: cargo doc --all-features --workspace --no-deps --locked --exclude pezkuwi-zombienet-sdk-tests
- name: script
id: required
run: |
git config --global --add safe.directory '*'
cargo doc --all-features --workspace --no-deps --locked --exclude pezkuwi-zombienet-sdk-tests
- run: rm -f ./target/doc/.lock
- run: mv ./target/doc ./crate-docs
- name: Inject Simple Analytics script