Skip to content

Docker actions create files and directories with root:root ownership, breaking later steps #1282

Description

@travisdowns

Describe the bug
Files created by a docker-based action are owned by root:root which means they can't be modified by subsequent actions or steps running as the default runner user.

To Reproduce
I made a repro in a repo.

The docker action writes a file hello, and a step outside the action writes hello-outside. You can see their permissions in the actions output:

 id outside the container: uid=1001(runner) gid=121(docker) groups=121(docker),4(adm),101(systemd-journal)
total 0
-rw-r--r-- 1 root   root   0 Aug 21 04:31 hello
-rw-r--r-- 1 runner docker 0 Aug 21 04:31 hello-outside

Expected behavior
The ownership of files created inside and outside of a docker container action should be the same, or at least the permissions should be set appropriately so the files aren't "off limits" to the runner user.

Runner Version and Platform

Current Linux hosted github runner.

This is similar to #434 but that issue talks about self-hosted runners on two consecutive runs. This issue happens entirely within one run.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions