From cd2d6538b6f082698a5814491d36ce1e30dad2fc Mon Sep 17 00:00:00 2001 From: volcano0dr Date: Mon, 25 Apr 2022 11:49:37 +0800 Subject: [PATCH] Workaround git 'unsafe repository' Signed-off-by: volcano0dr --- .github/workflows/code_coverage.yaml | 13 +++++++++++++ .github/workflows/composite_action/hw/action.yml | 13 +++++++++++++ .github/workflows/composite_action/sim/action.yml | 13 +++++++++++++ 3 files changed, 39 insertions(+) diff --git a/.github/workflows/code_coverage.yaml b/.github/workflows/code_coverage.yaml index 07cab37e..7942d1f5 100644 --- a/.github/workflows/code_coverage.yaml +++ b/.github/workflows/code_coverage.yaml @@ -19,6 +19,19 @@ jobs: - name: Create container run: docker run -itd --name=code_coverage -e OCCLUM_LOG_LEVEL=trace -v $GITHUB_WORKSPACE:/root/occlum occlum/occlum:${{ env.OCCLUM_VERSION }}-ubuntu20.04 + + - name: work around permission issue + run: | + docker exec code_coverage bash -c "git config --global --add safe.directory /root/occlum"; + docker exec code_coverage bash -c "git config --global --add safe.directory /root/occlum/deps/grpc-rust"; + docker exec code_coverage bash -c "git config --global --add safe.directory /root/occlum/deps/itoa-sgx"; + docker exec code_coverage bash -c "git config --global --add safe.directory /root/occlum/deps/resolv-conf"; + docker exec code_coverage bash -c "git config --global --add safe.directory /root/occlum/deps/ringbuf"; + docker exec code_coverage bash -c "git config --global --add safe.directory /root/occlum/deps/rust-sgx-sdk"; + docker exec code_coverage bash -c "git config --global --add safe.directory /root/occlum/deps/sefs"; + docker exec code_coverage bash -c "git config --global --add safe.directory /root/occlum/deps/serde-json-sgx"; + docker exec code_coverage bash -c "git config --global --add safe.directory /root/occlum/deps/serde-sgx" + shell: bash - name: Build dependencies run: docker exec code_coverage bash -c "cargo uninstall sccache || true; cd /root/occlum; make submodule" diff --git a/.github/workflows/composite_action/hw/action.yml b/.github/workflows/composite_action/hw/action.yml index efe3ed35..316f2e3e 100644 --- a/.github/workflows/composite_action/hw/action.yml +++ b/.github/workflows/composite_action/hw/action.yml @@ -60,6 +60,19 @@ runs: docker exec ${{ env.CONTAINER_NAME }} bash -c "git config --global https.proxy socks5://localhost:5432" shell: bash + - name: work around permission issue + run: | + docker exec ${{ env.CONTAINER_NAME }} bash -c "git config --global --add safe.directory /root/occlum"; + docker exec ${{ env.CONTAINER_NAME }} bash -c "git config --global --add safe.directory /root/occlum/deps/grpc-rust"; + docker exec ${{ env.CONTAINER_NAME }} bash -c "git config --global --add safe.directory /root/occlum/deps/itoa-sgx"; + docker exec ${{ env.CONTAINER_NAME }} bash -c "git config --global --add safe.directory /root/occlum/deps/resolv-conf"; + docker exec ${{ env.CONTAINER_NAME }} bash -c "git config --global --add safe.directory /root/occlum/deps/ringbuf"; + docker exec ${{ env.CONTAINER_NAME }} bash -c "git config --global --add safe.directory /root/occlum/deps/rust-sgx-sdk"; + docker exec ${{ env.CONTAINER_NAME }} bash -c "git config --global --add safe.directory /root/occlum/deps/sefs"; + docker exec ${{ env.CONTAINER_NAME }} bash -c "git config --global --add safe.directory /root/occlum/deps/serde-json-sgx"; + docker exec ${{ env.CONTAINER_NAME }} bash -c "git config --global --add safe.directory /root/occlum/deps/serde-sgx" + shell: bash + - name: Build dependencies run: docker exec ${{ env.CONTAINER_NAME }} bash -c "cargo uninstall sccache || true; cd /root/occlum; make submodule" shell: bash diff --git a/.github/workflows/composite_action/sim/action.yml b/.github/workflows/composite_action/sim/action.yml index dc6076c3..95e8fb7c 100644 --- a/.github/workflows/composite_action/sim/action.yml +++ b/.github/workflows/composite_action/sim/action.yml @@ -28,6 +28,19 @@ runs: run: docker run -itd --name=${{ inputs.container-name }} -v $GITHUB_WORKSPACE:/root/occlum occlum/occlum:${{ env.OCCLUM_VERSION }}-${{ inputs.os }} shell: bash + - name: work around permission issue + run: | + docker exec ${{ inputs.container-name }} bash -c "git config --global --add safe.directory /root/occlum"; + docker exec ${{ inputs.container-name }} bash -c "git config --global --add safe.directory /root/occlum/deps/grpc-rust"; + docker exec ${{ inputs.container-name }} bash -c "git config --global --add safe.directory /root/occlum/deps/itoa-sgx"; + docker exec ${{ inputs.container-name }} bash -c "git config --global --add safe.directory /root/occlum/deps/resolv-conf"; + docker exec ${{ inputs.container-name }} bash -c "git config --global --add safe.directory /root/occlum/deps/ringbuf"; + docker exec ${{ inputs.container-name }} bash -c "git config --global --add safe.directory /root/occlum/deps/rust-sgx-sdk"; + docker exec ${{ inputs.container-name }} bash -c "git config --global --add safe.directory /root/occlum/deps/sefs"; + docker exec ${{ inputs.container-name }} bash -c "git config --global --add safe.directory /root/occlum/deps/serde-json-sgx"; + docker exec ${{ inputs.container-name }} bash -c "git config --global --add safe.directory /root/occlum/deps/serde-sgx" + shell: bash + - name: Build dependencies run: docker exec ${{ inputs.container-name }} bash -c "cd /root/occlum; make submodule" shell: bash