Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: Expression evaluated to false, workflow not run #532

Closed
dave-irvine opened this issue Feb 16, 2021 · 5 comments
Closed

Issue: Expression evaluated to false, workflow not run #532

dave-irvine opened this issue Feb 16, 2021 · 5 comments
Assignees
Labels
kind/bug Something isn't working needs-work Extra attention is needed stale-exempt Exempt from stale

Comments

@dave-irvine
Copy link

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')' 
@dave-irvine dave-irvine added the kind/bug Something isn't working label Feb 16, 2021
@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the stale label Mar 19, 2021
@dave-irvine
Copy link
Author

Still an ongoing issue stale-bot! :)

@github-actions github-actions bot removed the stale label Mar 20, 2021
@catthehacker catthehacker added needs-work Extra attention is needed stale-exempt Exempt from stale labels Apr 2, 2021
@catthehacker catthehacker self-assigned this Aug 9, 2021
@miguelaferreira

This comment has been minimized.

@whereisrysmind

This comment has been minimized.

@ZauberNerd
Copy link
Contributor

This has been fixed with: #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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working needs-work Extra attention is needed stale-exempt Exempt from stale
Projects
None yet
Development

No branches or pull requests

5 participants