From 32d2c1ab4c5c77efaae9ba70e740f02c26472c3a Mon Sep 17 00:00:00 2001 From: riccardopinosio Date: Thu, 21 Mar 2024 09:45:26 +0100 Subject: [PATCH] fix: cicd file permission issues --- .github/workflows/release.yaml | 2 +- .github/workflows/test.yaml | 2 +- scripts/entrypoint.sh | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3abf10c..0018a88 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -23,7 +23,7 @@ jobs: run: | go mod download - name: Build and run tests - run: make run-tests + run: make clean run-tests - name: Install goveralls run: go install github.com/mattn/goveralls@latest - name: Send coverage diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index aa626c6..6b425e4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,7 +20,7 @@ jobs: run: | go mod download - name: Build and run tests - run: make run-tests + run: make clean run-tests - name: Install goveralls run: go install github.com/mattn/goveralls@latest - name: Send coverage diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 72166be..a287628 100644 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -15,6 +15,11 @@ user_name=testuser # the container non-privileged user (see dockerfile) if [[ -n $HOST_UID ]] && [[ $HOST_UID != 1000 ]]; then # patching internal $user_name to have the required host user id usermod -u "$HOST_UID" $user_name + echo "Patched $user_name to have uid $HOST_UID" +fi + +if [[ -d "/build" ]]; then + chown -R testuser:testuser /build fi echo "$1 running with user: $user_name"