[GH-ISSUE #1008] Issue: Error in if expression return code 0. #592

Closed
opened 2026-03-01 21:44:48 +03:00 by kerem · 1 comment
Owner

Originally created by @mvrshvl on GitHub (Feb 22, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1008

System information

  • Operating System: Linux
  • Architecture: x64 (64-bit)
  • Docker version: 20.10.12
  • Docker image used in act: golang:1.16.5-alpine
  • act version: act version 0.2.25-41-gff13844-dirty

Expected behaviour

The act returns a non-zero error code about an incorrectly described yaml file

Actual behaviour

The act returns an error log, but the exit code is 0.

Trace with nil error:

github.com/nektos/act@e23223ad02/pkg/runner/run_context.go (L278)

github.com/nektos/act@7dbf3fcb96/pkg/common/executor.go (L153)

github.com/nektos/act@e23223ad02/pkg/runner/run_context.go (L414)

github.com/nektos/act@7dbf3fcb96/pkg/common/executor.go (L156)

Workflow and/or repository

jobs:
  lints:
    if: something
    runs-on: ubuntu-latest
    timeout-minutes: 60
    container: golang:1.16.5-alpine
    steps:
      - uses: actions/checkout@v1

Steps to reproduce

Run a workflow with the same job as in the step Workflow and/or repository.

act output

[GitHub Actions/lints] Error in if: expression - lints

Originally created by @mvrshvl on GitHub (Feb 22, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1008 ## System information - Operating System: Linux - Architecture: x64 (64-bit) - Docker version: 20.10.12 - Docker image used in `act`: golang:1.16.5-alpine - `act` version: act version 0.2.25-41-gff13844-dirty ## Expected behaviour The act returns a non-zero error code about an incorrectly described yaml file ## Actual behaviour The act returns an error log, but the exit code is 0. Trace with nil error: https://github.com/nektos/act/blob/e23223ad02ddeafe581df97c7e9462df28d8e104/pkg/runner/run_context.go#L278 https://github.com/nektos/act/blob/7dbf3fcb96e2d70b3436b718c1f4a9fe4b169a4f/pkg/common/executor.go#L153 https://github.com/nektos/act/blob/e23223ad02ddeafe581df97c7e9462df28d8e104/pkg/runner/run_context.go#L414 https://github.com/nektos/act/blob/7dbf3fcb96e2d70b3436b718c1f4a9fe4b169a4f/pkg/common/executor.go#L156 ## Workflow and/or repository ``` jobs: lints: if: something runs-on: ubuntu-latest timeout-minutes: 60 container: golang:1.16.5-alpine steps: - uses: actions/checkout@v1 ``` ## Steps to reproduce Run a workflow with the same job as in the step `Workflow and/or repository`. ## `act` output [GitHub Actions/lints] ❌ Error in if: expression - lints
kerem 2026-03-01 21:44:48 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

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

A fix for this and some improvements in the log output in case of errors is included in: https://github.com/nektos/act/pull/1009

<!-- gh-comment-id:1047818437 --> @ZauberNerd commented on GitHub (Feb 22, 2022): A fix for this and some improvements in the log output in case of errors is included in: https://github.com/nektos/act/pull/1009
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#592
No description provided.