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
+2
View File
@@ -50,6 +50,7 @@ jobs:
- name: script
id: required
run: |
git config --global --add safe.directory '*'
cargo clippy --all-targets --all-features --locked --workspace --quiet
check-try-runtime:
@@ -77,6 +78,7 @@ jobs:
- name: script
id: required
run: |
git config --global --add safe.directory '*'
cargo check --locked --all --features try-runtime --quiet
# Check that teyrchain-template will compile with `try-runtime` feature flag.
cargo check --locked -p teyrchain-template-node --features try-runtime
+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
+7 -2
View File
@@ -46,7 +46,9 @@ jobs:
run: rustup target add wasm32v1-none || true
- name: script
id: required
run: WASM_BUILD_NO_COLOR=1 cargo test -p pezstaging-node-cli --release --locked -- --ignored
run: |
git config --global --add safe.directory '*'
WASM_BUILD_NO_COLOR=1 cargo test -p pezstaging-node-cli --release --locked -- --ignored
# https://github.com/pezkuwichain/ci_cd/issues/864
test-linux-stable-runtime-benchmarks:
@@ -72,7 +74,9 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: script
id: required
run: cargo nextest run --workspace --features runtime-benchmarks benchmark --locked --cargo-profile testnet --cargo-quiet
run: |
git config --global --add safe.directory '*'
cargo nextest run --workspace --features runtime-benchmarks benchmark --locked --cargo-profile testnet --cargo-quiet
test-linux-stable:
needs: [preflight]
@@ -154,6 +158,7 @@ jobs:
- name: script
id: required
run: |
git config --global --add safe.directory '*'
cargo nextest run --workspace \
--locked \
--release \