[GH-ISSUE #1159] Error in if-expression: "if: ${{ !contains(github.event.head_commit.message, '#no-gha') }}" (Unable to dereference 'message' on non-struct 'invalid') #650

Closed
opened 2026-03-01 21:45:14 +03:00 by kerem · 2 comments
Owner

Originally created by @dodalovic on GitHub (May 11, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1159

The tool fails with the following message:

act -n
Error:   ❌  Error in if-expression: "if: ${{ !contains(github.event.head_commit.message, '#no-gha') }}" (Unable to dereference 'message' on non-struct 'invalid')

, when given such workflow...

jobs:
  build-jar:
    runs-on: ubuntu-latest
    if: ${{ !contains(github.event.head_commit.message, '#no-gha') }}
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-java@v2
Originally created by @dodalovic on GitHub (May 11, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1159 The tool fails with the following message: ```shell act -n Error: ❌ Error in if-expression: "if: ${{ !contains(github.event.head_commit.message, '#no-gha') }}" (Unable to dereference 'message' on non-struct 'invalid') ``` , when given such workflow... ```yaml jobs: build-jar: runs-on: ubuntu-latest if: ${{ !contains(github.event.head_commit.message, '#no-gha') }} steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v2 ```
kerem 2026-03-01 21:45:14 +03:00
Author
Owner

@adzimzf commented on GitHub (May 20, 2022):

I face the same problem using the act latest version

<!-- gh-comment-id:1133056515 --> @adzimzf commented on GitHub (May 20, 2022): I face the same problem using the `act` latest version
Author
Owner

@ChristopherHX commented on GitHub (May 24, 2022):

Duplicate of #1071

The fix will be released in the next release v0.2.27.
However you can install the version based on latest commit read this section if you are using homebrew on linux/macOS https://github.com/nektos/act#homebrew-linuxmacos, otherwise build the master branch of this project from source e.g. go build.

<!-- gh-comment-id:1136422227 --> @ChristopherHX commented on GitHub (May 24, 2022): Duplicate of #1071 The fix will be released in the next release v0.2.27. However you can install the version based on latest commit read this section if you are using homebrew on linux/macOS https://github.com/nektos/act#homebrew-linuxmacos, otherwise build the master branch of this project from source e.g. `go build`.
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#650
No description provided.