[PR #1085] [MERGED] refactor: remove composite action runcontext workaround #1766

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

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/1085
Author: @KnisterPeter
Created: 3/29/2022
Status: Merged
Merged: 5/11/2022
Merged by: @mergify[bot]

Base: masterHead: remove-composite-runcontext-workaround


📝 Commits (10+)

  • 4e89488 refactor: remove composite action runcontext workaround
  • 96c95f1 test: check env-vars for local js and docker actions
  • 0f07904 test: test remote docker and js actions
  • 2f37c49 fix: merge github context into env when read and setup
  • 36d8ac3 refacotr: simplify composite context setup
  • ae15be2 test: use a map matcher to test input setup
  • d76c84d fix: restore composite log output
  • 056d840 fix: add RunContext JobName to fill GITHUB_JOBNAME
  • b41d466 test: use nektos/act-test-actions
  • ff586d8 fix: allow masking values in composite actions

📊 Changes

23 files changed (+391 additions, -162 deletions)

View changed files

📝 cmd/root.go (+1 -0)
📝 pkg/container/docker_run.go (+11 -0)
📝 pkg/runner/action.go (+126 -60)
📝 pkg/runner/action_test.go (+9 -22)
📝 pkg/runner/expression.go (+2 -12)
📝 pkg/runner/logger.go (+32 -4)
📝 pkg/runner/run_context.go (+1 -54)
📝 pkg/runner/run_context_test.go (+11 -1)
📝 pkg/runner/runner.go (+1 -0)
📝 pkg/runner/runner_test.go (+33 -0)
📝 pkg/runner/step.go (+7 -3)
📝 pkg/runner/step_run.go (+9 -6)
pkg/runner/testdata/act-composite-env-test/action1/action.yml (+21 -0)
pkg/runner/testdata/act-composite-env-test/action2/action.yml (+21 -0)
pkg/runner/testdata/act-composite-env-test/push.yml (+13 -0)
pkg/runner/testdata/actions-environment-and-context-tests/docker/Dockerfile (+5 -0)
pkg/runner/testdata/actions-environment-and-context-tests/docker/action.yml (+5 -0)
pkg/runner/testdata/actions-environment-and-context-tests/docker/entrypoint.sh (+26 -0)
pkg/runner/testdata/actions-environment-and-context-tests/js/action.yml (+5 -0)
pkg/runner/testdata/actions-environment-and-context-tests/js/index.js (+15 -0)

...and 3 more files

📄 Description

The RunContext is cloned to execute a composite action with all its
steps in a similar context. This required some workaround, since
the command handler has kept a reference to the original RunContext.

This is solved now, by replacing the docker LogWriter with a proper
scoped LogWriter.

This prepares for a simpler setup of composite actions to be able
to create and re-create the composite RunContext for pre/main/post
action steps.


🔄 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/1085 **Author:** [@KnisterPeter](https://github.com/KnisterPeter) **Created:** 3/29/2022 **Status:** ✅ Merged **Merged:** 5/11/2022 **Merged by:** [@mergify[bot]](https://github.com/apps/mergify) **Base:** `master` ← **Head:** `remove-composite-runcontext-workaround` --- ### 📝 Commits (10+) - [`4e89488`](https://github.com/nektos/act/commit/4e8948807b8f3dfd89a4437b9a370a2df669aa9b) refactor: remove composite action runcontext workaround - [`96c95f1`](https://github.com/nektos/act/commit/96c95f16cbb7782f06ac1b4140105901472335d9) test: check env-vars for local js and docker actions - [`0f07904`](https://github.com/nektos/act/commit/0f0790439ff2bea6edd9bfa57dd07d9f361b33f8) test: test remote docker and js actions - [`2f37c49`](https://github.com/nektos/act/commit/2f37c49fdba3f48715484b03e4d637960eec1c1c) fix: merge github context into env when read and setup - [`36d8ac3`](https://github.com/nektos/act/commit/36d8ac3bb5d78bd35a96ffa4f5e671f4c1766ef2) refacotr: simplify composite context setup - [`ae15be2`](https://github.com/nektos/act/commit/ae15be223136d55199bccd3872b0f5b2be7980cf) test: use a map matcher to test input setup - [`d76c84d`](https://github.com/nektos/act/commit/d76c84d7e0b022461b54882669ca1a4d1114420f) fix: restore composite log output - [`056d840`](https://github.com/nektos/act/commit/056d840be9ca4cfd028e1a029ceb8ad78edc032b) fix: add RunContext JobName to fill GITHUB_JOBNAME - [`b41d466`](https://github.com/nektos/act/commit/b41d4666a380bde279556216b0400c3d83b9f5c4) test: use nektos/act-test-actions - [`ff586d8`](https://github.com/nektos/act/commit/ff586d80538b1ad0e73768caca4d28f75d4a259c) fix: allow masking values in composite actions ### 📊 Changes **23 files changed** (+391 additions, -162 deletions) <details> <summary>View changed files</summary> 📝 `cmd/root.go` (+1 -0) 📝 `pkg/container/docker_run.go` (+11 -0) 📝 `pkg/runner/action.go` (+126 -60) 📝 `pkg/runner/action_test.go` (+9 -22) 📝 `pkg/runner/expression.go` (+2 -12) 📝 `pkg/runner/logger.go` (+32 -4) 📝 `pkg/runner/run_context.go` (+1 -54) 📝 `pkg/runner/run_context_test.go` (+11 -1) 📝 `pkg/runner/runner.go` (+1 -0) 📝 `pkg/runner/runner_test.go` (+33 -0) 📝 `pkg/runner/step.go` (+7 -3) 📝 `pkg/runner/step_run.go` (+9 -6) ➕ `pkg/runner/testdata/act-composite-env-test/action1/action.yml` (+21 -0) ➕ `pkg/runner/testdata/act-composite-env-test/action2/action.yml` (+21 -0) ➕ `pkg/runner/testdata/act-composite-env-test/push.yml` (+13 -0) ➕ `pkg/runner/testdata/actions-environment-and-context-tests/docker/Dockerfile` (+5 -0) ➕ `pkg/runner/testdata/actions-environment-and-context-tests/docker/action.yml` (+5 -0) ➕ `pkg/runner/testdata/actions-environment-and-context-tests/docker/entrypoint.sh` (+26 -0) ➕ `pkg/runner/testdata/actions-environment-and-context-tests/js/action.yml` (+5 -0) ➕ `pkg/runner/testdata/actions-environment-and-context-tests/js/index.js` (+15 -0) _...and 3 more files_ </details> ### 📄 Description The RunContext is cloned to execute a composite action with all its steps in a similar context. This required some workaround, since the command handler has kept a reference to the original RunContext. This is solved now, by replacing the docker LogWriter with a proper scoped LogWriter. This prepares for a simpler setup of composite actions to be able to create and re-create the composite RunContext for pre/main/post action steps. --- <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:35 +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#1766
No description provided.