From e381ccd377874b12014972590ae979aeabf4ccc8 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Fri, 8 Nov 2024 20:24:22 +0100 Subject: [PATCH] Update Dockerfile and GitHub Actions for safe directory config --- .devcontainer/Dockerfile | 3 ++- .github/workflows/main.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 913f5bae..83964baa 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -10,10 +10,11 @@ RUN groupadd -g $GROUP_ID -o user && \ ENV BUNDLE_PATH=/cache/bundle RUN apt-get update && \ - apt-get install -y cmake && \ + apt-get install -y cmake git && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* +RUN git config --global --add safe.directory * RUN gem install solargraph bundler:2.3.3 COPY Gemfile Gemfile.lock git_fame.gemspec ./ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b3e56fe1..8052669e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -96,4 +96,4 @@ jobs: run: docker build -t git-fame -f .devcontainer/Dockerfile --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) . - name: Run tests in Docker container - run: docker run --rm -v $(pwd):/workspace git-fame bundle exec rspec + run: docker run --rm -v $(pwd):/workspace --user $(id -u):$(id -g) git-fame bundle exec rspec