From b82900ee95db51f774080cceaf06d3fb1de5ed21 Mon Sep 17 00:00:00 2001 From: Stefano Bonicatti Date: Fri, 5 Jul 2024 20:06:22 +0200 Subject: [PATCH] Go back using root --- .github/workflows/self_hosted_runners.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/self_hosted_runners.yml b/.github/workflows/self_hosted_runners.yml index f47fe4bb9e3..b32cb5fcca6 100644 --- a/.github/workflows/self_hosted_runners.yml +++ b/.github/workflows/self_hosted_runners.yml @@ -186,7 +186,7 @@ jobs: container: image: osquery/builder20.04:7e9ee0339 - options: --privileged --init -v /var/run/docker.sock:/var/run/docker.sock --pid=host --user 1001 + options: --privileged --init -v /var/run/docker.sock:/var/run/docker.sock --pid=host --user root strategy: matrix: @@ -207,15 +207,7 @@ jobs: - name: Setup the build paths id: build_paths run: | - # The self hosted runner host user is root, differently from hosted runners, - # so we need to change permissions of the workspace folders to the current user - sudo chown -R runner:runner /__w - - ls -ld /__w - ls -ld /__w/_temp - ls -ld /__w/_temp/_runner_file_commands - - # Also, the group for the docker socket doesn't have gid docker + # The group for the docker socket doesn't have gid docker sudo chown root:docker /var/run/docker.sock rel_build_path="workspace/usr/src/debug/osquery/build" @@ -350,7 +342,7 @@ jobs: - name: Run the tests as normal user working-directory: ${{ steps.build_paths.outputs.BINARY }} run: | - ctest --build-nocmake -LE "root-required" -V + sudo -u runner ctest --build-nocmake -LE "root-required" -V - name: Run the tests as root user working-directory: ${{ steps.build_paths.outputs.BINARY }}