[PR #930] [MERGED] fix: rework setupShellCommand #1688

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

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/930
Author: @catthehacker
Created: 12/16/2021
Status: Merged
Merged: 12/22/2021
Merged by: @mergify[bot]

Base: masterHead: cat/fix/run-step


📝 Commits (2)

  • bd70028 fix: rework setupShellCommand
  • 18c648a lint(editorconfig): ignore *_test.go due to mixed style

📊 Changes

9 files changed (+164 additions, -79 deletions)

View changed files

📝 .editorconfig (+1 -1)
📝 pkg/model/workflow_test.go (+1 -0)
📝 pkg/runner/runner_test.go (+2 -0)
📝 pkg/runner/step_context.go (+89 -70)
📝 pkg/runner/testdata/shells/bash/push.yml (+16 -2)
pkg/runner/testdata/shells/custom/push.yml (+14 -0)
📝 pkg/runner/testdata/shells/pwsh/push.yml (+12 -2)
📝 pkg/runner/testdata/shells/python/push.yml (+13 -2)
📝 pkg/runner/testdata/shells/sh/push.yml (+16 -2)

📄 Description

  • move all logic to separate function so we can test that later
  • split step.Shell and step.WorkingDirectory setup into own funcs
  • general cleanup of function
  • use ActPath to not collide with checked out repository (also avoids issues if path contains spaces)
  • use shellquote.Split() instead of strings.Fields() for better command split
  • replace single string concat with fmt

Fixes #884
Fixes #865

Signed-off-by: hackercat me@hackerc.at


🔄 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/930 **Author:** [@catthehacker](https://github.com/catthehacker) **Created:** 12/16/2021 **Status:** ✅ Merged **Merged:** 12/22/2021 **Merged by:** [@mergify[bot]](https://github.com/apps/mergify) **Base:** `master` ← **Head:** `cat/fix/run-step` --- ### 📝 Commits (2) - [`bd70028`](https://github.com/nektos/act/commit/bd7002836835fa9b3c688cd135def47433875092) fix: rework `setupShellCommand` - [`18c648a`](https://github.com/nektos/act/commit/18c648a0e35be856afe78bb2948ab4e854fa2116) lint(editorconfig): ignore *_test.go due to mixed style ### 📊 Changes **9 files changed** (+164 additions, -79 deletions) <details> <summary>View changed files</summary> 📝 `.editorconfig` (+1 -1) 📝 `pkg/model/workflow_test.go` (+1 -0) 📝 `pkg/runner/runner_test.go` (+2 -0) 📝 `pkg/runner/step_context.go` (+89 -70) 📝 `pkg/runner/testdata/shells/bash/push.yml` (+16 -2) ➕ `pkg/runner/testdata/shells/custom/push.yml` (+14 -0) 📝 `pkg/runner/testdata/shells/pwsh/push.yml` (+12 -2) 📝 `pkg/runner/testdata/shells/python/push.yml` (+13 -2) 📝 `pkg/runner/testdata/shells/sh/push.yml` (+16 -2) </details> ### 📄 Description * move all logic to separate function so we can test that later * split `step.Shell` and `step.WorkingDirectory` setup into own funcs * general cleanup of function * use `ActPath` to not collide with checked out repository (also avoids issues if path contains spaces) * use `shellquote.Split()` instead of `strings.Fields()` for better command split * replace single string concat with `fmt` Fixes #884 Fixes #865 Signed-off-by: hackercat <me@hackerc.at> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:52:15 +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#1688
No description provided.