Repository: nektos/act (language: go)

Issue:
act does not evaluate step names
### Bug report info

```plain text
act version:            0.2.31
GOOS:                   darwin
GOARCH:                 arm64
NumCPU:                 10
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
        /var/run/docker.sock
Config files:           
        /Users/bas/.actrc:
                -P ubuntu-latest=catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
        Go version:            go1.19
        Module path:           command-line-arguments
        Main version:          
        Main path:             
        Main checksum:         
        Build settings:
                -compiler:            gc
                -ldflags:             -X main.version=0.2.31
                CGO_ENABLED:          1
                CGO_CFLAGS:           
                CGO_CPPFLAGS:         
                CGO_CXXFLAGS:         
                CGO_LDFLAGS:          
                GOARCH:               arm64
                GOOS:                 darwin
Docker Engine:
        Engine version:        20.10.17
        Engine runtime:        runc
        Cgroup version:        2
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Docker Desktop
        OS type:               linux
        OS version:            
        OS arch:               aarch64
        OS kernel:             5.10.124-linuxkit
        OS CPU:                5
        OS memory:             7851 MB
        Security options:
                name=seccomp,profile=default
                name=cgroupns
```


### Command used with act

```sh
act --actor basz --secret-file=.secrets --container-architecture linux/amd64
```


### Describe issue

Mayby a question, mayby a bug

the matrix variables are not "expanded" in the output. Shouldn't they be?

### Link to GitHub repository

_No response_

### Workflow content

```yml
on:
  workflow_dispatch:
  # schedule:
  #   - cron: "0 0 * * 0,3"
  push:
    branches:
      - "main"

name: "Build And Push PHP Docker Images"

jobs:
  build-and-push-docker:
    name: "Build And Push PHP Docker Images"

    runs-on: ${{ matrix.operating-system }}

    strategy:
      fail-fast: false
      matrix:
        php-version:
          - "7.4"
          - "8.0"
          - "8.1"
        php-target:
          - "cli"
          - "fpm"
        operating-system:
          - "ubuntu-latest"

    steps:
      - name: "Checkout"
        uses: actions/checkout@v3

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v2
        platforms: amd64,arm64

        # @see https://github.com/docker/setup-buildx-action#quick-start
      - name: Set up Docker Buildx
        id: buildx
        uses: docker/setup-buildx-action@v2
        with:
          install: true
          driver: docker-container
          config: .github/buildkitd.toml
          buildkitd-flags: --debug

      - name: Inspect builder
        run: |
          echo "Name:      ${{ steps.buildx.outputs.name }}"
          echo "Endpoint:  ${{ steps.buildx.outputs.endpoint }}"
          echo "Status:    ${{ steps.buildx.outputs.status }}"
          echo "Flags:     ${{ steps.buildx.outputs.flags }}"
          echo "Platforms: ${{ steps.buildx.outputs.platforms }}"

      - name: Login to GitHub Container Registry
        uses: docker/login-action@v2
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: "Build ${{ matrix.php-version }}-${{ matrix.php-target }}"
        working-directory: php
        run: |
          docker build . --file php-${{ matrix.php-target }} --platform linux/amd64,linux/arm64 --push --tag ghcr.io/plhw/lab-docker/php-test:${{ matrix.php-version }}-${{ matrix.php-target }}
        env:
          PHP_VERSION: ${{ matrix.php-version }}
```


### Relevant log output

```sh
[Build And Push PHP Docker Images/Build And Push PHP Docker Images-2] ⭐ Run Main Build ${{ matrix.php-version }}-${{ matrix.php-target }}
[Build And Push PHP Docker Images/Build And Push PHP Docker Images-3] ⭐ Run Main Build ${{ matrix.php-version }}-${{ matrix.php-target }}
```


### Additional information

_No response_


Discussion / hints:
As I understand it's only logged name of step.
do these variables expanded during execution?
yes. execution is fine
Issue is stale and will be closed in 14 days unless there is new activity

Fix patch:
diff --git a/pkg/runner/action_composite.go b/pkg/runner/action_composite.go
index a7b41438782..c1e94fcd2cd 100644
--- a/pkg/runner/action_composite.go
+++ b/pkg/runner/action_composite.go
@@ -71,6 +71,7 @@ func newCompositeRunContext(ctx context.Context, parent *RunContext, step action
 		Parent:       parent,
 		EventJSON:    parent.EventJSON,
 	}
+	compositerc.ExprEval = compositerc.NewExpressionEvaluator(ctx)
 
 	return compositerc
 }
diff --git a/pkg/runner/job_executor.go b/pkg/runner/job_executor.go
index 547e234c91c..e1de6cbc7ab 100644
--- a/pkg/runner/job_executor.go
+++ b/pkg/runner/job_executor.go
@@ -133,7 +133,7 @@ func newJobExecutor(info jobInfo, sf stepFactory, rc *RunContext) common.Executo
 
 func useStepLogger(rc *RunContext, stepModel *model.Step, stage stepStage, executor common.Executor) common.Executor {
 	return func(ctx context.Context) error {
-		ctx = withStepLogger(ctx, stepModel.ID, stepModel.String(), stage.String())
+		ctx = withStepLogger(ctx, stepModel.ID, rc.ExprEval.Interpolate(ctx, stepModel.String()), stage.String())
 
 		rawLogger := common.Logger(ctx).WithField("raw_output", true)
 		logWriter := common.NewLineWriter(rc.commandHandler(ctx), func(s string) bool {
diff --git a/pkg/runner/step.go b/pkg/runner/step.go
index 8a9d2b6d797..f730ac1aeb8 100644
--- a/pkg/runner/step.go
+++ b/pkg/runner/step.go
@@ -90,7 +90,7 @@ func runStepExecutor(step step, stage stepStage, executor common.Executor) commo
 			return nil
 		}
 
-		stepString := stepModel.String()
+		stepString := rc.ExprEval.Interpolate(ctx, stepModel.String())
 		if strings.Contains(stepString, "::add-mask::") {
 			stepString = "add-mask command"
 		}


Test patch:
diff --git a/pkg/runner/job_executor_test.go b/pkg/runner/job_executor_test.go
index edcbfc1b9e6..e00a4fd656f 100644
--- a/pkg/runner/job_executor_test.go
+++ b/pkg/runner/job_executor_test.go
@@ -249,7 +249,17 @@ func TestNewJobExecutor(t *testing.T) {
 			sfm := &stepFactoryMock{}
 			rc := &RunContext{
 				JobContainer: &jobContainerMock{},
+				Run: &model.Run{
+					JobID: "test",
+					Workflow: &model.Workflow{
+						Jobs: map[string]*model.Job{
+							"test": {},
+						},
+					},
+				},
+				Config: &Config{},
 			}
+			rc.ExprEval = rc.NewExpressionEvaluator(ctx)
 			executorOrder := make([]string, 0)
 
 			jim.On("steps").Return(tt.steps)
diff --git a/pkg/runner/step_action_local_test.go b/pkg/runner/step_action_local_test.go
index 6b14f3d2399..639028989a2 100644
--- a/pkg/runner/step_action_local_test.go
+++ b/pkg/runner/step_action_local_test.go
@@ -275,6 +275,7 @@ func TestStepActionLocalPost(t *testing.T) {
 				Step:   tt.stepModel,
 				action: tt.actionModel,
 			}
+			sal.RunContext.ExprEval = sal.RunContext.NewExpressionEvaluator(ctx)
 
 			if tt.mocks.env {
 				cm.On("UpdateFromImageEnv", &sal.env).Return(func(ctx context.Context) error { return nil })
diff --git a/pkg/runner/step_action_remote_test.go b/pkg/runner/step_action_remote_test.go
index 84fe082926d..72b0eeeb3a4 100644
--- a/pkg/runner/step_action_remote_test.go
+++ b/pkg/runner/step_action_remote_test.go
@@ -155,6 +155,7 @@ func TestStepActionRemote(t *testing.T) {
 				readAction: sarm.readAction,
 				runAction:  sarm.runAction,
 			}
+			sar.RunContext.ExprEval = sar.RunContext.NewExpressionEvaluator(ctx)
 
 			suffixMatcher := func(suffix string) interface{} {
 				return mock.MatchedBy(func(actionDir string) bool {
@@ -586,6 +587,7 @@ func TestStepActionRemotePost(t *testing.T) {
 				Step:   tt.stepModel,
 				action: tt.actionModel,
 			}
+			sar.RunContext.ExprEval = sar.RunContext.NewExpressionEvaluator(ctx)
 
 			if tt.mocks.env {
 				cm.On("UpdateFromImageEnv", &sar.env).Return(func(ctx context.Context) error { return nil })
diff --git a/pkg/runner/step_docker_test.go b/pkg/runner/step_docker_test.go
index e0e8575f476..2008357f5c0 100644
--- a/pkg/runner/step_docker_test.go
+++ b/pkg/runner/step_docker_test.go
@@ -25,6 +25,8 @@ func TestStepDockerMain(t *testing.T) {
 		ContainerNewContainer = origContainerNewContainer
 	})()
 
+	ctx := context.Background()
+
 	sd := &stepDocker{
 		RunContext: &RunContext{
 			StepResults: map[string]*model.StepResult{},
@@ -51,8 +53,7 @@ func TestStepDockerMain(t *testing.T) {
 			WorkingDirectory: "workdir",
 		},
 	}
-
-	ctx := context.Background()
+	sd.RunContext.ExprEval = sd.RunContext.NewExpressionEvaluator(ctx)
 
 	cm.On("UpdateFromImageEnv", mock.AnythingOfType("*map[string]string")).Return(func(ctx context.Context) error {
 		return nil