[PR #666] [CLOSED] WIP: Enable Non-Root Runner Scenarios #1547

Closed
opened 2026-03-01 21:51:38 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/666
Author: @JustinGrote
Created: 5/5/2021
Status: Closed

Base: masterHead: feature/EnableNonRootWorkers


📝 Commits (6)

  • 035206b Change default non-bind path to runner directory
  • 056a0d9 Fix basic test to write in workspace container
  • 2477a14 Fix Dockerfile not compiling correctly on windows
  • 139ed1d Supress excessively verbose reference tag info
  • a33f97a Add chown and mkdir functions for non-root scenarios
  • 42b0385 Linter fix

📊 Changes

5 files changed (+57 additions, -11 deletions)

View changed files

.gitattributes (+3 -0)
📝 pkg/common/git.go (+3 -2)
📝 pkg/container/docker_run.go (+47 -5)
📝 pkg/model/workflow.go (+2 -2)
📝 pkg/runner/testdata/basic/push.yml (+2 -2)

📄 Description

Currently act requires the docker container to have root privileges to work because it both binds and mounts to the "same path" as the host.

While the bind method is useful if using act as a task runner, the mount method will fail in non-root containers.

In order to more accurately test Github Actions for both permission and pathing errors, this PR makes mounts use the runner workdir by default and sets permissions accordingly. Binds with the -b flag will be unaffected and will continue to use the same path as what is on the container.

It will also add a parameter to customize the starting container workdir separately from the host workdir, if there is such a situation where you dont' want to use the default (usually /home/runner/workdir)

Example that this will fix

Try a simple action that does mkdir -p /my/random/path. This will work just fine in act, but fail in Github Actions, and you won't find out till you run it in github actions.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nektos/act/pull/666 **Author:** [@JustinGrote](https://github.com/JustinGrote) **Created:** 5/5/2021 **Status:** ❌ Closed **Base:** `master` ← **Head:** `feature/EnableNonRootWorkers` --- ### 📝 Commits (6) - [`035206b`](https://github.com/nektos/act/commit/035206b15f1ef7ff9f916ccf33a8d7f3b0ca7d72) Change default non-bind path to runner directory - [`056a0d9`](https://github.com/nektos/act/commit/056a0d9dea74aaadf40fc36e1c063c21f87c56c0) Fix basic test to write in workspace container - [`2477a14`](https://github.com/nektos/act/commit/2477a14bc6a6939c279edc7032f46e72cd0f7ad4) Fix Dockerfile not compiling correctly on windows - [`139ed1d`](https://github.com/nektos/act/commit/139ed1d207929de57850333dde1ad39db4bccb02) Supress excessively verbose reference tag info - [`a33f97a`](https://github.com/nektos/act/commit/a33f97adc99d80b80ce1665ce7b417ed99b94b42) Add chown and mkdir functions for non-root scenarios - [`42b0385`](https://github.com/nektos/act/commit/42b0385bd2fb7a8337e83b865fb576b6f6db8805) Linter fix ### 📊 Changes **5 files changed** (+57 additions, -11 deletions) <details> <summary>View changed files</summary> ➕ `.gitattributes` (+3 -0) 📝 `pkg/common/git.go` (+3 -2) 📝 `pkg/container/docker_run.go` (+47 -5) 📝 `pkg/model/workflow.go` (+2 -2) 📝 `pkg/runner/testdata/basic/push.yml` (+2 -2) </details> ### 📄 Description Currently act requires the docker container to have root privileges to work because it both binds and mounts to the "same path" as the host. While the bind method is useful if using act as a task runner, the mount method will fail in non-root containers. In order to more accurately test Github Actions for both permission and pathing errors, this PR makes mounts use the runner workdir by default and sets permissions accordingly. Binds with the -b flag will be unaffected and will continue to use the same path as what is on the container. It will also add a parameter to customize the starting container workdir separately from the host workdir, if there is such a situation where you dont' want to use the default (usually /home/runner/workdir) # Example that this will fix Try a simple action that does `mkdir -p /my/random/path`. This will work just fine in act, but fail in Github Actions, and you won't find out till you run it in github actions. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:51:38 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#1547
No description provided.