[PR #772] [MERGED] Add proper support for working-directory & fix command builder #1599

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

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/772
Author: @catthehacker
Created: 8/9/2021
Status: Merged
Merged: 8/10/2021
Merged by: @mergify[bot]

Base: masterHead: cat/fix/workdir


📝 Commits (5)

  • 6c04f95 fix: align other Docker executors to print action
  • 66ae3a9 fix: formatting
  • 981379c fix: add proper workdir support
  • 4363f1d fix: replace script filepath after slice creation
  • e2557b0 fix: match substring so it works for pwsh

📊 Changes

6 files changed (+76 additions, -36 deletions)

View changed files

📝 pkg/container/docker_run.go (+33 -15)
📝 pkg/runner/run_context.go (+4 -3)
📝 pkg/runner/step_context.go (+16 -12)
📝 pkg/runner/testdata/basic/push.yml (+1 -0)
pkg/runner/testdata/dir with spaces/push.yml (+7 -0)
📝 pkg/runner/testdata/workdir/push.yml (+15 -6)

📄 Description

changelog:

  • working-directory: is set through Docker now instead of adding cd %s to script
  • workdir cases:
    • if starts /, it replaces workdir during that exec
    • if doesn't start with /, merge with current workdir
    • if empty, leave it alone and use what has been used before (container workdir)
  • few formatting touches
  • Print Docker executors to Info loglevel, when pulling (big) images this should let user know what is currently happening (currently it doesn't show anything about pull without verbose option)
  • Replace pattern to script path after command has been re-split for Docker

Fixes https://github.com/nektos/act/issues/211
Fixes https://github.com/nektos/act/issues/748


🔄 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/772 **Author:** [@catthehacker](https://github.com/catthehacker) **Created:** 8/9/2021 **Status:** ✅ Merged **Merged:** 8/10/2021 **Merged by:** [@mergify[bot]](https://github.com/apps/mergify) **Base:** `master` ← **Head:** `cat/fix/workdir` --- ### 📝 Commits (5) - [`6c04f95`](https://github.com/nektos/act/commit/6c04f95ec9f35bb17bb679e90b64c4ecefb334e4) fix: align other Docker executors to print action - [`66ae3a9`](https://github.com/nektos/act/commit/66ae3a9eff5d81f595e59261d8195d03c7d57a17) fix: formatting - [`981379c`](https://github.com/nektos/act/commit/981379c0651385ab3355a3bdc9c9955db73a99c5) fix: add proper workdir support - [`4363f1d`](https://github.com/nektos/act/commit/4363f1dea8de61783557301f393d4031870a57f3) fix: replace script filepath after slice creation - [`e2557b0`](https://github.com/nektos/act/commit/e2557b047996e0aa003865081cdf4395530fa4fb) fix: match substring so it works for pwsh ### 📊 Changes **6 files changed** (+76 additions, -36 deletions) <details> <summary>View changed files</summary> 📝 `pkg/container/docker_run.go` (+33 -15) 📝 `pkg/runner/run_context.go` (+4 -3) 📝 `pkg/runner/step_context.go` (+16 -12) 📝 `pkg/runner/testdata/basic/push.yml` (+1 -0) ➕ `pkg/runner/testdata/dir with spaces/push.yml` (+7 -0) 📝 `pkg/runner/testdata/workdir/push.yml` (+15 -6) </details> ### 📄 Description changelog: - `working-directory:` is set through Docker now instead of adding `cd %s` to script - workdir cases: - if starts `/`, it replaces workdir during that exec - if doesn't start with `/`, merge with current workdir - if empty, leave it alone and use what has been used before (container workdir) - few formatting touches - Print Docker executors to `Info` loglevel, when pulling (big) images this should let user know what is currently happening (currently it doesn't show anything about pull without verbose option) - Replace pattern to script path **after** command has been re-split for Docker Fixes https://github.com/nektos/act/issues/211 Fixes https://github.com/nektos/act/issues/748 --- <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:52 +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#1599
No description provided.