fix file permission for non root user docker image (#334)
This commit is contained in:
parent
17c7ecead2
commit
26e4270e41
4 changed files with 14 additions and 3 deletions
|
@ -122,11 +122,11 @@ func (rc *RunContext) startJobContainer() common.Executor {
|
||||||
rc.JobContainer.CopyDir(copyToPath, rc.Config.Workdir+"/.").IfBool(copyWorkspace),
|
rc.JobContainer.CopyDir(copyToPath, rc.Config.Workdir+"/.").IfBool(copyWorkspace),
|
||||||
rc.JobContainer.Copy("/github/", &container.FileEntry{
|
rc.JobContainer.Copy("/github/", &container.FileEntry{
|
||||||
Name: "workflow/event.json",
|
Name: "workflow/event.json",
|
||||||
Mode: 644,
|
Mode: 0644,
|
||||||
Body: rc.EventJSON,
|
Body: rc.EventJSON,
|
||||||
}, &container.FileEntry{
|
}, &container.FileEntry{
|
||||||
Name: "home/.act",
|
Name: "home/.act",
|
||||||
Mode: 644,
|
Mode: 0644,
|
||||||
Body: "",
|
Body: "",
|
||||||
}),
|
}),
|
||||||
)(ctx)
|
)(ctx)
|
||||||
|
|
|
@ -45,6 +45,7 @@ func TestRunEvent(t *testing.T) {
|
||||||
{"fail", "push", "exit with `FAILURE`: 1"},
|
{"fail", "push", "exit with `FAILURE`: 1"},
|
||||||
{"runs-on", "push", ""},
|
{"runs-on", "push", ""},
|
||||||
{"job-container", "push", ""},
|
{"job-container", "push", ""},
|
||||||
|
{"job-container-non-root", "push", ""},
|
||||||
{"uses-docker-url", "push", ""},
|
{"uses-docker-url", "push", ""},
|
||||||
{"remote-action-docker", "push", ""},
|
{"remote-action-docker", "push", ""},
|
||||||
{"remote-action-js", "push", ""},
|
{"remote-action-js", "push", ""},
|
||||||
|
|
|
@ -129,7 +129,7 @@ func (sc *StepContext) setupShellCommand() common.Executor {
|
||||||
sc.Cmd = strings.Fields(strings.Replace(step.ShellCommand(), "{0}", containerPath, 1))
|
sc.Cmd = strings.Fields(strings.Replace(step.ShellCommand(), "{0}", containerPath, 1))
|
||||||
return rc.JobContainer.Copy("/github/", &container.FileEntry{
|
return rc.JobContainer.Copy("/github/", &container.FileEntry{
|
||||||
Name: scriptName,
|
Name: scriptName,
|
||||||
Mode: 755,
|
Mode: 0755,
|
||||||
Body: script.String(),
|
Body: script.String(),
|
||||||
})(ctx)
|
})(ctx)
|
||||||
}
|
}
|
||||||
|
|
10
pkg/runner/testdata/job-container-non-root/push.yml
vendored
Normal file
10
pkg/runner/testdata/job-container-non-root/push.yml
vendored
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
name: job-container
|
||||||
|
on: push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ocaml/opam2:debian-9-opam
|
||||||
|
steps:
|
||||||
|
- run: echo PASS
|
Loading…
Reference in a new issue