Repository: nektos/act (language: go)

Issue:
Issue: act cannot evaluate if-condition (Unable to index on non-slice value: invalid)
## System information

- Operating System: Windows 10 Pro
- Architecture: x64 (64-bit)
- Apple M1: no
- Docker version: 20.10.13
- Docker image used in `act`: Micro
- `act` version: act version 0.2.26

## Expected behaviour

Test job should be started and if-condition should be parsed.

## Actual behaviour

I tried to run my "test" job with `act -j test` but unfortunately "act" does not understand this "if" condition (which is valid GitHub Actions syntax, see https://github.com/bennycode/demo-repo/commit/e000f425ac12328cb43c1bdf5805944d9a04407a):

```yml
jobs:
  test:
    runs-on: ${{ matrix.os }}
    if: |
      contains(github.event.commits[0].message, '[skip ci]') == false &&
      contains(github.event.commits[0].message, '[ci skip]') == false   
```

**Output:**

> Error in if-expression: "if: contains(github.event.commits[0].message, '[skip ci]') == false &&
contains(github.event.commits[0].message, '[ci skip]') == false
" (Unable to index on non-slice value: invalid)

## Workflow and/or repository

Repository: https://github.com/bennycode/demo-repo

<details>
  <summary>workflow</summary>

```none
name: 'Test'

on:
  pull_request:
  push:
    branches: [ 'main' ]
  workflow_dispatch:

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ 'ubuntu-latest' ]
        node-version: [ '16.x' ]
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - name: 'Checkout repository'
        uses: actions/checkout@v3

      # Uses specific version of Node.js
      - name: 'Use Node.js v${{ matrix.node-version }}'
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node-version }}

      # Runs commands using the runners shell
      - name: 'Run tests'
        run: |
          npm install
          npx tsc --noEmit
          npm test
```

</details>

## Steps to reproduce

1. Clone https://github.com/bennycode/demo-repo
2. Run `act -j test`

## `act` output

<!--
    - Use `act` with `-v`/`--verbose` and paste output from your terminal in code block below
-->

<details>
  <summary>Log</summary>

```none
act.exe -j test
Error:   ❌  Error in if-expression: "if: contains(github.event.commits[0].message, '[skip ci]') == false &&
contains(github.event.commits[0].message, '[ci skip]') == false
" (Unable to index on non-slice value: invalid)
```

</details>



Discussion / hints:

Fix patch:
diff --git a/pkg/exprparser/interpreter.go b/pkg/exprparser/interpreter.go
index 787bbda27f3..6287e701bb7 100644
--- a/pkg/exprparser/interpreter.go
+++ b/pkg/exprparser/interpreter.go
@@ -175,11 +175,11 @@ func (impl *interperterImpl) evaluateIndexAccess(indexAccessNode *actionlint.Ind
 			}
 			return leftValue.Index(int(rightValue.Int())).Interface(), nil
 		default:
-			return nil, fmt.Errorf("Unable to index on non-slice value: %s", leftValue.Kind())
+			return nil, nil
 		}
 
 	default:
-		return nil, fmt.Errorf("Unknown index type: %s", rightValue.Kind())
+		return nil, nil
 	}
 }
 
@@ -260,7 +260,7 @@ func (impl *interperterImpl) getPropertyValue(left reflect.Value, property strin
 		return values, nil
 	}
 
-	return nil, fmt.Errorf("Unable to dereference '%s' on non-struct '%s'", property, left.Kind())
+	return nil, nil
 }
 
 func (impl *interperterImpl) getMapValue(value reflect.Value) (interface{}, error) {


Test patch:
diff --git a/pkg/exprparser/interpreter_test.go b/pkg/exprparser/interpreter_test.go
index 83078d6e62d..c6b15c30b39 100644
--- a/pkg/exprparser/interpreter_test.go
+++ b/pkg/exprparser/interpreter_test.go
@@ -47,8 +47,12 @@ func TestOperators(t *testing.T) {
 		{"(false || (false || true))", true, "logical-grouping", ""},
 		{"github.action", "push", "property-dereference", ""},
 		{"github['action']", "push", "property-index", ""},
-		{"github.action[0]", nil, "string-index", "Unable to index on non-slice value: string"},
+		{"github.action[0]", nil, "string-index", ""},
+		{"github.action['0']", nil, "string-index", ""},
 		{"fromJSON('[0,1]')[1]", 1.0, "array-index", ""},
+		{"fromJSON('[0,1]')[1.1]", nil, "array-index", ""},
+		// Disabled weird things are happening
+		// {"fromJSON('[0,1]')['1.1']", nil, "array-index", ""},
 		{"(github.event.commits.*.author.username)[0]", "someone", "array-index-0", ""},
 		{"fromJSON('[0,1]')[2]", nil, "array-index-out-of-bounds-0", ""},
 		{"fromJSON('[0,1]')[34553]", nil, "array-index-out-of-bounds-1", ""},
@@ -524,6 +528,9 @@ func TestContexts(t *testing.T) {
 		name     string
 	}{
 		{"github.action", "push", "github-context"},
+		{"github.event.commits[0].message", nil, "github-context-noexist-prop"},
+		{"fromjson('{\"commits\":[]}').commits[0].message", nil, "github-context-noexist-prop"},
+		{"github.event.pull_request.labels.*.name", nil, "github-context-noexist-prop"},
 		{"env.TEST", "value", "env-context"},
 		{"job.status", "success", "job-context"},
 		{"steps.step-id.outputs.name", "value", "steps-context"},