-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Runner FeatureFeature scope to the runnerFeature scope to the runnerenhancementNew feature or requestNew feature or request
Description
Description
Run the containers as the same user running on the host (the VM) by default, or at least provide an option. The related docker option would be docker run --user "$(id -u):$(id -g)".
Containers job.container runs as the container's default user by default, which often is root. This causes some weird behaviors because the workspace on the GitHub runner is mounted to the container, and no other user (other than the Runner user) has permission to write on it. This is what makes @actions/checkout fail when running on containers.
As Jenkins does, this should be made by default. Users who might want to run as a different user can still use the --user docker option.
Workaround
jobs:
configure:
runs-on: ubuntu-latest
outputs:
uid_gid: ${{ steps.get-user.outputs.uid_gid }}
steps:
- id: get-user
run: echo "::set-output name=uid_gid::$(id -u):$(id -g)"
clone-and-install:
needs: configure
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/vscode/devcontainers/base:ubuntu
options: --user ${{ needs.configure.outputs.uid_gid }}
steps:
- uses: actions/checkout@v2It's even funny to have to do such a thing.
jecnua, Flyingmana, AlphaWong, hbfernandes, ScottPierce and 56 more
Metadata
Metadata
Assignees
Labels
Runner FeatureFeature scope to the runnerFeature scope to the runnerenhancementNew feature or requestNew feature or request