[PR #1472] [MERGED] refactor: fix add-path / GITHUB_PATH commands #1962

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

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/1472
Author: @ChristopherHX
Created: 11/27/2022
Status: Merged
Merged: 12/9/2022
Merged by: @mergify[bot]

Base: masterHead: fix-path-handling


📝 Commits (10+)

  • f330529 fix: add-path / GITHUB_PATH commands
  • a9555df Disable old code
  • eb83aa7 fix: missing mock
  • cb27189 Update tests
  • 0441b93 fix tests
  • 3f57c95 UpdateExtraPath skip on dryrun
  • 41cb290 patch test
  • dbfb4a3 Merge branch 'master' into fix-path-handling
  • 4857f26 Merge branch 'master' into fix-path-handling
  • a4b570e Merge branch 'master' into fix-path-handling

📊 Changes

12 files changed (+95 additions, -46 deletions)

View changed files

📝 pkg/runner/action.go (+6 -0)
📝 pkg/runner/command.go (+7 -1)
📝 pkg/runner/command_test.go (+2 -2)
📝 pkg/runner/container_mock_test.go (+11 -0)
📝 pkg/runner/run_context.go (+38 -9)
📝 pkg/runner/step.go (+9 -12)
📝 pkg/runner/step_action_local_test.go (+6 -5)
📝 pkg/runner/step_action_remote_test.go (+6 -2)
📝 pkg/runner/step_docker_test.go (+4 -4)
📝 pkg/runner/step_run.go (+1 -0)
📝 pkg/runner/step_run_test.go (+4 -4)
📝 pkg/runner/step_test.go (+1 -7)

📄 Description

The existing code applies prepend path for all actions, while it shouldn't do it for docker actions.
Additionally GITHUB_PATH shouldn't update the env directly, instead add to extrapath

Seems like the old ::add-path:: never worked correctly, because the first add-path always wins e.g.

  • add node12 as node
  • use node ver 12
  • add node16
  • still in version 12, node16 added to a later path component after node12

Duplicated path are now eliminated.

Resolves #1384

Still to complex for get it ready.


🔄 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/1472 **Author:** [@ChristopherHX](https://github.com/ChristopherHX) **Created:** 11/27/2022 **Status:** ✅ Merged **Merged:** 12/9/2022 **Merged by:** [@mergify[bot]](https://github.com/apps/mergify) **Base:** `master` ← **Head:** `fix-path-handling` --- ### 📝 Commits (10+) - [`f330529`](https://github.com/nektos/act/commit/f330529e15e53af4642f3247095f9a26d6d7adcd) fix: add-path / GITHUB_PATH commands - [`a9555df`](https://github.com/nektos/act/commit/a9555dff6b43807b80c9fb0df7ecdc752a29b41b) Disable old code - [`eb83aa7`](https://github.com/nektos/act/commit/eb83aa730d9b16af7780875598d68756927c405a) fix: missing mock - [`cb27189`](https://github.com/nektos/act/commit/cb271893b2ac027f3ddfc2ae3275229776300546) Update tests - [`0441b93`](https://github.com/nektos/act/commit/0441b933210a89b1eb4fabe1d9c1e41cae9c600f) fix tests - [`3f57c95`](https://github.com/nektos/act/commit/3f57c95695f8df6fff9e8b52ebad7d3548b8907a) UpdateExtraPath skip on dryrun - [`41cb290`](https://github.com/nektos/act/commit/41cb290061c65029e02574e62107242ea0d4bd80) patch test - [`dbfb4a3`](https://github.com/nektos/act/commit/dbfb4a31913aa3249ff9e2fbf1bad9f2c10b08e1) Merge branch 'master' into fix-path-handling - [`4857f26`](https://github.com/nektos/act/commit/4857f267c40bc2cf591384aae52f7b923ea38b3e) Merge branch 'master' into fix-path-handling - [`a4b570e`](https://github.com/nektos/act/commit/a4b570e80e20c85e290eb4f6f8d24de75e64b144) Merge branch 'master' into fix-path-handling ### 📊 Changes **12 files changed** (+95 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `pkg/runner/action.go` (+6 -0) 📝 `pkg/runner/command.go` (+7 -1) 📝 `pkg/runner/command_test.go` (+2 -2) 📝 `pkg/runner/container_mock_test.go` (+11 -0) 📝 `pkg/runner/run_context.go` (+38 -9) 📝 `pkg/runner/step.go` (+9 -12) 📝 `pkg/runner/step_action_local_test.go` (+6 -5) 📝 `pkg/runner/step_action_remote_test.go` (+6 -2) 📝 `pkg/runner/step_docker_test.go` (+4 -4) 📝 `pkg/runner/step_run.go` (+1 -0) 📝 `pkg/runner/step_run_test.go` (+4 -4) 📝 `pkg/runner/step_test.go` (+1 -7) </details> ### 📄 Description The existing code applies prepend path for all actions, while it shouldn't do it for docker actions. Additionally GITHUB_PATH shouldn't update the env directly, instead add to extrapath Seems like the old ::add-path:: never worked correctly, because the first add-path always wins e.g. - add node12 as node - use node ver 12 - add node16 - still in version 12, node16 added to a later path component after node12 Duplicated path are now eliminated. Resolves #1384 Still to complex for get it ready. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:53:25 +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#1962
No description provided.