[GH-ISSUE #532] Issue: Expression evaluated to false, workflow not run #358

Closed
opened 2026-03-01 21:42:39 +03:00 by kerem · 5 comments
Owner

Originally created by @dave-irvine on GitHub (Feb 16, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/532

Originally assigned to: @catthehacker on GitHub.

Act version

act version 0.2.20

Expected behaviour

I've defined an event that looks like this:

{
  "pull_request": {
    "labels": [
      {
        "name": "needs-qa"
      }
    ]
  }
}

And my workflow has a check that looks for a label on a pull-request:

jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest
    # Check to see if the labels on the PR contain a label named 'needs-qa'
    if: ${{ contains(github.event.pull_request.labels.*.name, 'needs-qa') }}

Given the event passed in with --eventpath I would expect my workflow to be run

Actual behaviour

My workflow is not run, with the following message:

DEBU[0000] expression '${{ contains(github.event.pull_request.labels.*.name, 'needs-qa') }}' evaluated to 'false' 

I think it might be related to how the expression is being evaluated?

DEBU[0000] Evaluating 'contains(github['event']['pull_request']['labels']['']*['name'], 'needs-qa')' instead of 'contains(github.event.pull_request.labels.*.name, 'needs-qa')' 
Originally created by @dave-irvine on GitHub (Feb 16, 2021). Original GitHub issue: https://github.com/nektos/act/issues/532 Originally assigned to: @catthehacker on GitHub. <!-- - Make sure you are able to reproduce it on the [latest version](https://github.com/nektos/act/releases) - Search the existing issues. - Refer to [README](https://github.com/nektos/act/blob/master/README.md). --> ## Act version <!-- Paste output of `act --version` --> ```none act version 0.2.20 ``` ## Expected behaviour <!-- Describe how whole process should go and finish --> I've defined an event that looks like this: ```json { "pull_request": { "labels": [ { "name": "needs-qa" } ] } } ``` And my workflow has a check that looks for a label on a pull-request: ```yml jobs: deploy: name: Deploy runs-on: ubuntu-latest # Check to see if the labels on the PR contain a label named 'needs-qa' if: ${{ contains(github.event.pull_request.labels.*.name, 'needs-qa') }} ``` Given the event passed in with `--eventpath` I would expect my workflow to be run ## Actual behaviour <!-- Describe what happened --> My workflow is not run, with the following message: ``` DEBU[0000] expression '${{ contains(github.event.pull_request.labels.*.name, 'needs-qa') }}' evaluated to 'false' ``` I think it might be related to how the expression is being evaluated? ``` DEBU[0000] Evaluating 'contains(github['event']['pull_request']['labels']['']*['name'], 'needs-qa')' instead of 'contains(github.event.pull_request.labels.*.name, 'needs-qa')' ```
kerem 2026-03-01 21:42:39 +03:00
Author
Owner

@github-actions[bot] commented on GitHub (Mar 19, 2021):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:802411119 --> @github-actions[bot] commented on GitHub (Mar 19, 2021): Issue is stale and will be closed in 14 days unless there is new activity
Author
Owner

@dave-irvine commented on GitHub (Mar 19, 2021):

Still an ongoing issue stale-bot! :)

<!-- gh-comment-id:802773382 --> @dave-irvine commented on GitHub (Mar 19, 2021): Still an ongoing issue stale-bot! :)
Author
Owner

@miguelaferreira commented on GitHub (Jan 3, 2022):

I'm facing this same issue.

<!-- gh-comment-id:1004004888 --> @miguelaferreira commented on GitHub (Jan 3, 2022): I'm facing this same issue.
Author
Owner

@whereisrysmind commented on GitHub (Jan 21, 2022):

bump.

<!-- gh-comment-id:1018677689 --> @whereisrysmind commented on GitHub (Jan 21, 2022): bump.
Author
Owner

@ZauberNerd commented on GitHub (Feb 1, 2022):

This has been fixed with: https://github.com/nektos/act/pull/908 and will be released with the next version.
If you want to try it out earlier, use one of the snapshots: https://github.com/nektos/act/actions/runs/1653750680 or install / build from master: https://github.com/nektos/act#go-linuxwindowsmacosany-other-platform-supported-by-go https://github.com/nektos/act#manually-building-from-source

<!-- gh-comment-id:1027161614 --> @ZauberNerd commented on GitHub (Feb 1, 2022): This has been fixed with: https://github.com/nektos/act/pull/908 and will be released with the next version. If you want to try it out earlier, use one of the snapshots: https://github.com/nektos/act/actions/runs/1653750680 or install / build from master: https://github.com/nektos/act#go-linuxwindowsmacosany-other-platform-supported-by-go https://github.com/nektos/act#manually-building-from-source
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#358
No description provided.