Repository: nektos/act (language: go)

Issue:
crash: "panic: runtime error: invalid memory address or nil pointer dereference"
### Bug report info

```plain text
act version:            0.2.44
GOOS:                   darwin
GOARCH:                 amd64
NumCPU:                 16
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
	/var/run/docker.sock
	/Users/ljharb/.docker/run/docker.sock
Config files:           
	/Users/ljharb/.actrc:
		-P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest
		-P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:act-18.04
Build info:
	Go version:            go1.20.2
	Module path:           command-line-arguments
	Main version:          
	Main path:             
	Main checksum:         
	Build settings:
		-buildmode:           exe
		-compiler:            gc
		-ldflags:             -X main.version=0.2.44
		CGO_ENABLED:          1
		CGO_CFLAGS:           
		CGO_CPPFLAGS:         
		CGO_CXXFLAGS:         
		CGO_LDFLAGS:          
		GOARCH:               amd64
		GOOS:                 darwin
		GOAMD64:              v1
Docker Engine:
	Engine version:        20.10.23
	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:               x86_64
	OS kernel:             5.15.49-linuxkit
	OS CPU:                4
	OS memory:             7959 MB
	Security options:
		name=seccomp,profile=default
		name=cgroupns
```


### Command used with act

```sh
`act -W .github/workflows/node-pretest.yml`
```


### Describe issue

I cloned the repo, and ran the command. I expected it to run the workflow, and it crashed.

### Link to GitHub repository

https://github.com/inspect-js/has-package-exports

### Workflow content

```yml
name: 'Tests: pretest/posttest'

on: [pull_request, push]

jobs:
  tests:
    uses: ljharb/actions/.github/workflows/pretest.yml@main
```


### Relevant log output

```sh
DEBU[0000] Loading environment from /Users/ljharb/git/inspect-js/has-package-exports.git/.env 
DEBU[0000] Loading action inputs from /Users/ljharb/git/inspect-js/has-package-exports.git/.input 
DEBU[0000] Loading secrets from /Users/ljharb/git/inspect-js/has-package-exports.git/.secrets 
DEBU[0000] Evaluated matrix inclusions: map[]           
DEBU[0000] Conditional GET for notices etag=680f3171-94eb-44c2-8389-46eb30ecffff 
DEBU[0000] Loading workflow '/Users/ljharb/git/inspect-js/has-package-exports.git/.github/workflows/node-pretest.yml' 
DEBU[0000] Reading workflow '/Users/ljharb/git/inspect-js/has-package-exports.git/.github/workflows/node-pretest.yml' 
DEBU[0000] Preparing plan with all jobs                 
DEBU[0000] Using default workflow event: push           
DEBU[0000] Planning jobs for event: push                
DEBU[0000] Final matrix after applying user inclusions '[map[]]' 
DEBU[0000] Loading revision from git directory          
DEBU[0000] Found revision: 8f5975042c6fa5f4c315364ccaee5a2d004df3a0 
DEBU[0000] HEAD points to '8f5975042c6fa5f4c315364ccaee5a2d004df3a0' 
DEBU[0000] using github ref: refs/heads/main            
DEBU[0000] Found revision: 8f5975042c6fa5f4c315364ccaee5a2d004df3a0 
[Tests: pretest/posttest/tests] [DEBUG] evaluating expression 'success()'
[Tests: pretest/posttest/tests] [DEBUG] expression 'success()' evaluated to 'true'
DEBU[0000] Loading workflow '/Users/ljharb/.cache/act/ljharb-actions-.github-workflows-pretest.yml@main/.github/workflows/pretest.yml' 
DEBU[0000] Reading workflow '/Users/ljharb/.cache/act/ljharb-actions-.github-workflows-pretest.yml@main/.github/workflows/pretest.yml' 
DEBU[0000] Final matrix after applying user inclusions '[map[]]' 
[Tests: pretest/posttest/tests] [DEBUG] Loading revision from git directory
[Tests: pretest/posttest/tests] [DEBUG] Found revision: 8f5975042c6fa5f4c315364ccaee5a2d004df3a0
[Tests: pretest/posttest/tests] [DEBUG] HEAD points to '8f5975042c6fa5f4c315364ccaee5a2d004df3a0'
[Tests: pretest/posttest/tests] [DEBUG] using github ref: refs/heads/main
[Tests: pretest/posttest/tests] [DEBUG] Found revision: 8f5975042c6fa5f4c315364ccaee5a2d004df3a0
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x16c2874]

goroutine 15 [running]:
github.com/nektos/act/pkg/runner.setupWorkflowInputs({0x1978500, 0xc000491ad0}, 0xc0000c6a80, 0xc0001b4000)
	/private/tmp/act-20230401-4555-1mg59bd/act-0.2.44/pkg/runner/expression.go:379 +0x74
github.com/nektos/act/pkg/runner.getEvaluatorInputs({0x1978500, 0xc000491ad0}, 0xc0001b4000, {0x0, 0x0}, 0xc000683380)
	/private/tmp/act-20230401-4555-1mg59bd/act-0.2.44/pkg/runner/expression.go:340 +0x85
github.com/nektos/act/pkg/runner.(*RunContext).NewExpressionEvaluatorWithEnv(0xc0001b4000, {0x1978500, 0xc000491ad0}, 0xc0001208a0)
	/private/tmp/act-20230401-4555-1mg59bd/act-0.2.44/pkg/runner/expression.go:69 +0x61b
github.com/nektos/act/pkg/runner.(*RunContext).NewExpressionEvaluator(0x1fb9108?, {0x1978500, 0xc000491ad0})
	/private/tmp/act-20230401-4555-1mg59bd/act-0.2.44/pkg/runner/expression.go:24 +0x3f
github.com/nektos/act/pkg/runner.(*runnerImpl).newRunContext(0xc0004b8680, {0x1978500, 0xc000491ad0}, 0xc000460fc0, 0xc000120630)
	/private/tmp/act-20230401-4555-1mg59bd/act-0.2.44/pkg/runner/runner.go:206 +0x139
github.com/nektos/act/pkg/runner.(*runnerImpl).NewPlanExecutor.func1({0x1978500, 0xc000491ad0})
	/private/tmp/act-20230401-4555-1mg59bd/act-0.2.44/pkg/runner/runner.go:135 +0x665
github.com/nektos/act/pkg/common.Executor.Then.func1({0x1978500, 0xc000491ad0})
	/private/tmp/act-20230401-4555-1mg59bd/act-0.2.44/pkg/common/executor.go:129 +0x34
github.com/nektos/act/pkg/runner.newReusableWorkflowExecutor.func1({0x1978500, 0xc000491ad0})
	/private/tmp/act-20230401-4555-1mg59bd/act-0.2.44/pkg/runner/reusable_workflow.go:86 +0xda
github.com/nektos/act/pkg/common.Executor.Then.func1({0x1978500, 0xc000491ad0})
	/private/tmp/act-20230401-4555-1mg59bd/act-0.2.44/pkg/common/executor.go:141 +0x144
github.com/nektos/act/pkg/runner.(*RunContext).Executor.func1({0x1978500, 0xc000491ad0})
	/private/tmp/act-20230401-4555-1mg59bd/act-0.2.44/pkg/runner/run_context.go:442 +0x58
github.com/nektos/act/pkg/runner.(*runnerImpl).NewPlanExecutor.func1.1({0x1978500, 0xc00042db30})
	/private/tmp/act-20230401-4555-1mg59bd/act-0.2.44/pkg/runner/runner.go:145 +0x193
github.com/nektos/act/pkg/common.NewParallelExecutor.func1.1(0x0?, 0x0?)
	/private/tmp/act-20230401-4555-1mg59bd/act-0.2.44/pkg/common/executor.go:100 +0x5c
created by github.com/nektos/act/pkg/common.NewParallelExecutor.func1
	/private/tmp/act-20230401-4555-1mg59bd/act-0.2.44/pkg/common/executor.go:98 +0x89
```


### Additional information

_No response_


Discussion / hints:
I also encountered this problem.
+1
> on: workflow_call

Seems like this is not implemented correctly.

https://github.com/nektos/act/blob/148a54502167880f90dbf2f68ff44478679f41dd/pkg/model/workflow.go#L125-L128

I guess only the following reusable workflow trigger are working
```yaml
on:
  workflow_call:
```

Fix patch:
diff --git a/pkg/model/workflow.go b/pkg/model/workflow.go
index d7e2922b72b..35e4587bae6 100644
--- a/pkg/model/workflow.go
+++ b/pkg/model/workflow.go
@@ -123,7 +123,8 @@ type WorkflowCallResult struct {
 
 func (w *Workflow) WorkflowCallConfig() *WorkflowCall {
 	if w.RawOn.Kind != yaml.MappingNode {
-		return nil
+		// The callers expect for "on: workflow_call" and "on: [ workflow_call ]" a non nil return value
+		return &WorkflowCall{}
 	}
 
 	var val map[string]yaml.Node


Test patch:
diff --git a/pkg/runner/testdata/.github/workflows/local-reusable-workflow-no-inputs-array.yml b/pkg/runner/testdata/.github/workflows/local-reusable-workflow-no-inputs-array.yml
new file mode 100644
index 00000000000..3df4ae3ac4b
--- /dev/null
+++ b/pkg/runner/testdata/.github/workflows/local-reusable-workflow-no-inputs-array.yml
@@ -0,0 +1,10 @@
+name: reusable
+
+on:
+- workflow_call
+
+jobs:
+  reusable_workflow_job:
+    runs-on: ubuntu-latest
+    steps:
+    - run: echo Test
\ No newline at end of file
diff --git a/pkg/runner/testdata/.github/workflows/local-reusable-workflow-no-inputs-string.yml b/pkg/runner/testdata/.github/workflows/local-reusable-workflow-no-inputs-string.yml
new file mode 100644
index 00000000000..7558c1c5158
--- /dev/null
+++ b/pkg/runner/testdata/.github/workflows/local-reusable-workflow-no-inputs-string.yml
@@ -0,0 +1,9 @@
+name: reusable
+
+on: workflow_call
+
+jobs:
+  reusable_workflow_job:
+    runs-on: ubuntu-latest
+    steps:
+    - run: echo Test
\ No newline at end of file
diff --git a/pkg/runner/testdata/uses-workflow/local-workflow.yml b/pkg/runner/testdata/uses-workflow/local-workflow.yml
index 070e4d0c1d7..2e9a08d720c 100644
--- a/pkg/runner/testdata/uses-workflow/local-workflow.yml
+++ b/pkg/runner/testdata/uses-workflow/local-workflow.yml
@@ -19,6 +19,12 @@ jobs:
       number_required: 1
     secrets: inherit
 
+  reusable-workflow-with-on-string-notation:
+    uses: ./.github/workflows/local-reusable-workflow-no-inputs-string.yml
+
+  reusable-workflow-with-on-array-notation:
+    uses: ./.github/workflows/local-reusable-workflow-no-inputs-array.yml
+
   output-test:
     runs-on: ubuntu-latest
     needs: