[GH-ISSUE #1657] cannot unmarshal !!str true if... into bool #821

Closed
opened 2026-03-01 21:46:40 +03:00 by kerem · 3 comments
Owner

Originally created by @ccontino84 on GitHub (Mar 2, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1657

Bug report info

act version:            0.2.43
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 12
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
	/var/run/docker.sock
Config files:           
	/home/contino/.actrc:
		-P self-hosted=ttim2cr.azurecr.io/gh-runner-az:v2
		-P staging-2c-8gb=ttim2cr.azurecr.io/gh-runner-az:v2
Build info:
	Go version:            go1.18.10
	Module path:           github.com/nektos/act
	Main version:          (devel)
	Main path:             github.com/nektos/act
	Main checksum:         
	Build settings:
		-compiler:            gc
		-ldflags:             -s -w -X main.version=0.2.43 -X main.commit=44b510f48cac6a58654bf920ee26cc6e1d36ac3a -X main.date=2023-03-01T02:33:51Z -X main.builtBy=goreleaser
		CGO_ENABLED:          0
		GOARCH:               amd64
		GOOS:                 linux
		GOAMD64:              v1
		vcs:                  git
		vcs.revision:         44b510f48cac6a58654bf920ee26cc6e1d36ac3a
		vcs.time:             2023-03-01T02:33:29Z
		vcs.modified:         false
Docker Engine:
	Engine version:        23.0.1
	Engine runtime:        runc
	Cgroup version:        1
	Cgroup driver:         cgroupfs
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Ubuntu 18.04.6 LTS
	OS type:               linux
	OS version:            18.04
	OS arch:               x86_64
	OS kernel:             4.15.0-204-generic
	OS CPU:                12
	OS memory:             31828 MB
	Security options:
		name=apparmor
		name=seccomp,profile=builtin

Command used with act

act -j job -W .github/workflows/job.yml

Describe issue

The following configuration is perfectly fine in GH:

name: 'Name'
description: 'Description.'
inputs:
  action:
    description: Action to perform in case this action is triggered by `workflow_dispatch`
    required: true if `event_name` is `workflow_dispatch`.
  event_name:
    description: The name of the event triggering this action (pull_request, push, workflow_dispatch)
    required: true

but it fails with the following error when I run the job locally with act:

cannot unmarshal !!str `true if...` into bool

No response

Workflow content

name: 'Name'
description: 'Description.'
inputs:
  action:
    description: Action to perform in case this action is triggered by `workflow_dispatch`
    required: true if `event_name` is `workflow_dispatch`.
  event_name:
    description: The name of the event triggering this action (pull_request, push, workflow_dispatch)
    required: true

Relevant log output

[JOB] yaml: unmarshal errors:
  line 6: cannot unmarshal !!str `true if...` into bool

Additional information

No response

Originally created by @ccontino84 on GitHub (Mar 2, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1657 ### Bug report info ```plain text act version: 0.2.43 GOOS: linux GOARCH: amd64 NumCPU: 12 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /home/contino/.actrc: -P self-hosted=ttim2cr.azurecr.io/gh-runner-az:v2 -P staging-2c-8gb=ttim2cr.azurecr.io/gh-runner-az:v2 Build info: Go version: go1.18.10 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -compiler: gc -ldflags: -s -w -X main.version=0.2.43 -X main.commit=44b510f48cac6a58654bf920ee26cc6e1d36ac3a -X main.date=2023-03-01T02:33:51Z -X main.builtBy=goreleaser CGO_ENABLED: 0 GOARCH: amd64 GOOS: linux GOAMD64: v1 vcs: git vcs.revision: 44b510f48cac6a58654bf920ee26cc6e1d36ac3a vcs.time: 2023-03-01T02:33:29Z vcs.modified: false Docker Engine: Engine version: 23.0.1 Engine runtime: runc Cgroup version: 1 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Ubuntu 18.04.6 LTS OS type: linux OS version: 18.04 OS arch: x86_64 OS kernel: 4.15.0-204-generic OS CPU: 12 OS memory: 31828 MB Security options: name=apparmor name=seccomp,profile=builtin ``` ### Command used with act ```sh act -j job -W .github/workflows/job.yml ``` ### Describe issue The following configuration is perfectly fine in GH: ```yml name: 'Name' description: 'Description.' inputs: action: description: Action to perform in case this action is triggered by `workflow_dispatch` required: true if `event_name` is `workflow_dispatch`. event_name: description: The name of the event triggering this action (pull_request, push, workflow_dispatch) required: true ``` but it fails with the following error when I run the job locally with act: ```text cannot unmarshal !!str `true if...` into bool ``` ### Link to GitHub repository _No response_ ### Workflow content ```yml name: 'Name' description: 'Description.' inputs: action: description: Action to perform in case this action is triggered by `workflow_dispatch` required: true if `event_name` is `workflow_dispatch`. event_name: description: The name of the event triggering this action (pull_request, push, workflow_dispatch) required: true ``` ### Relevant log output ```sh [JOB] yaml: unmarshal errors: line 6: cannot unmarshal !!str `true if...` into bool ``` ### Additional information _No response_
kerem 2026-03-01 21:46:40 +03:00
Author
Owner

@alex-savchuk commented on GitHub (Mar 3, 2023):

I reproduce this with "on.workflow_call.inputs" (https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_call) but not with top-level "inputs":

name: 'Name'
description: 'Description.'

on:
  workflow_dispatch:
    inputs:
      action:
        description: Action to perform in case this action is triggered by `workflow_dispatch`
        required: true if `event_name` is `workflow_dispatch`.
      event_name:
        description: The name of the event triggering this action (pull_request, push, workflow_dispatch)
        required: true

jobs:
  valid-JOB-Name-v123-docker_hub:
    runs-on: ubuntu-latest
    steps:
      - run: echo hi

The following configuration is perfectly fine in GH

Do you mean for "fine" that this condition "if event_name is workflow_dispatch." is working (required is becoming true or false) or this condition is ignored and used as comment?

<!-- gh-comment-id:1452795396 --> @alex-savchuk commented on GitHub (Mar 3, 2023): I reproduce this with "on.workflow_call.inputs" (https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_call) but not with top-level "inputs": ``` name: 'Name' description: 'Description.' on: workflow_dispatch: inputs: action: description: Action to perform in case this action is triggered by `workflow_dispatch` required: true if `event_name` is `workflow_dispatch`. event_name: description: The name of the event triggering this action (pull_request, push, workflow_dispatch) required: true jobs: valid-JOB-Name-v123-docker_hub: runs-on: ubuntu-latest steps: - run: echo hi ``` > The following configuration is perfectly fine in GH Do you mean for "fine" that this condition "if `event_name` is `workflow_dispatch`." is working (required is becoming true or false) or this condition is ignored and used as comment?
Author
Owner

@ccontino84 commented on GitHub (Mar 3, 2023):

Sorry I forgot to mention that the job doesn't run as a standalone job, it's a composite action. The required property works as expected when running in GH, but most importantly it doesn't fail with an error.
Let me know if you need more information, unfortunately I can't upload the whole file.
To be more clear, this is the sample configuration:

name: 'Name'
description: 'Description.'

on:
  workflow_dispatch:
    inputs:
      action:
        description: Action to perform in case this action is triggered by `workflow_dispatch`
        required: true if `event_name` is `workflow_dispatch`.
      event_name:
        description: The name of the event triggering this action (pull_request, push, workflow_dispatch)
        required: true

runs:
  using: "composite"
  steps:
      - run: echo hi
<!-- gh-comment-id:1453492802 --> @ccontino84 commented on GitHub (Mar 3, 2023): Sorry I forgot to mention that the job doesn't run as a standalone job, it's a composite action. The `required` property works as expected when running in GH, but most importantly it doesn't fail with an error. Let me know if you need more information, unfortunately I can't upload the whole file. To be more clear, this is the sample configuration: ``` name: 'Name' description: 'Description.' on: workflow_dispatch: inputs: action: description: Action to perform in case this action is triggered by `workflow_dispatch` required: true if `event_name` is `workflow_dispatch`. event_name: description: The name of the event triggering this action (pull_request, push, workflow_dispatch) required: true runs: using: "composite" steps: - run: echo hi ```
Author
Owner

@github-actions[bot] commented on GitHub (Aug 31, 2023):

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

<!-- gh-comment-id:1700038354 --> @github-actions[bot] commented on GitHub (Aug 31, 2023): Issue is stale and will be closed in 14 days unless there is new activity
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#821
No description provided.