[GH-ISSUE #1690] Syntax error in an action isn't precisely located in an action by error message #837

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

Originally created by @Porkepix on GitHub (Mar 20, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1690

Bug report info

$ act --bug-report
act version:            0.2.43.r19.g9fab5995
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 16
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
	/var/run/docker.sock
Config files:
	/home/clement/.actrc:
		-P ubuntu-latest=catthehacker/ubuntu:act-latest
		-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
		-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
	.actrc:
		-P ubuntu-latest=catthehacker/ubuntu:act-latest
		-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
		-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
	Go version:            go1.20.2
	Module path:           command-line-arguments
	Main version:
	Main path:
	Main checksum:
	Build settings:
		-buildmode:           pie
		-compiler:            gc
		-trimpath:            true
		CGO_ENABLED:          1
		GOARCH:               amd64
		GOOS:                 linux
		GOAMD64:              v1
Docker Engine:
	Engine version:        23.0.1
	Engine runtime:        runc
	Cgroup version:        2
	Cgroup driver:         systemd
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Arch Linux
	OS type:               linux
	OS version:
	OS arch:               x86_64
	OS kernel:             6.1.11-arch1-1
	OS CPU:                16
	OS memory:             31802 MB
	Security options:
		name=seccomp,profile=builtin
		name=cgroupns

Command used with act

act -j [job_name]

Describe issue

Slight syntax issue in action is not correctly shown as coming from the action nor is the message clear to understand the issue.

Here's the syntax mistake in the action:

    - name: Checkout a repository
        uses: actions/checkout@v3
        with:
          repository: foo/bar

No response

Workflow content

Just a call to an action

Relevant log output

$ act -j job only shows this as logs:

[Tests/job] 🚀  Start image=catthehacker/ubuntu:act-latest
[Tests/job]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Tests/job]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Tests/job]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Tests/job]   ☁  git clone 'https://github.com/foo/bar' # ref=main
[Tests/job] 🏁  Job succeeded
Error: yaml: line 21: mapping values are not allowed in this context

Additional information

As you can see, all that's shown is an unclear error message with a location as a line number.
It happens that this line number was the correct one, but is located within the action, which might not be clear enough when it's in the middle of many other things. It should be made more obvious this comes from within an action and which one.

A clearer error message could also be nice, but I think YAML could make it quite hard to do and at the very least this kind of errors would be spotted very quickly if correctly located (action and line number).

Originally created by @Porkepix on GitHub (Mar 20, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1690 ### Bug report info ```plain text $ act --bug-report act version: 0.2.43.r19.g9fab5995 GOOS: linux GOARCH: amd64 NumCPU: 16 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /home/clement/.actrc: -P ubuntu-latest=catthehacker/ubuntu:act-latest -P ubuntu-22.04=catthehacker/ubuntu:act-22.04 -P ubuntu-20.04=catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=catthehacker/ubuntu:act-18.04 .actrc: -P ubuntu-latest=catthehacker/ubuntu:act-latest -P ubuntu-22.04=catthehacker/ubuntu:act-22.04 -P ubuntu-20.04=catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=catthehacker/ubuntu:act-18.04 Build info: Go version: go1.20.2 Module path: command-line-arguments Main version: Main path: Main checksum: Build settings: -buildmode: pie -compiler: gc -trimpath: true CGO_ENABLED: 1 GOARCH: amd64 GOOS: linux GOAMD64: v1 Docker Engine: Engine version: 23.0.1 Engine runtime: runc Cgroup version: 2 Cgroup driver: systemd Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Arch Linux OS type: linux OS version: OS arch: x86_64 OS kernel: 6.1.11-arch1-1 OS CPU: 16 OS memory: 31802 MB Security options: name=seccomp,profile=builtin name=cgroupns ``` ### Command used with act ```sh act -j [job_name] ``` ### Describe issue Slight syntax issue in action is not correctly shown as coming from the action nor is the message clear to understand the issue. Here's the syntax mistake in the action: ``` - name: Checkout a repository uses: actions/checkout@v3 with: repository: foo/bar ``` ### Link to GitHub repository _No response_ ### Workflow content ```yml Just a call to an action ``` ### Relevant log output `$ act -j job` only shows this as logs: ```sh [Tests/job] 🚀 Start image=catthehacker/ubuntu:act-latest [Tests/job] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true [Tests/job] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [Tests/job] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [Tests/job] ☁ git clone 'https://github.com/foo/bar' # ref=main [Tests/job] 🏁 Job succeeded Error: yaml: line 21: mapping values are not allowed in this context ``` ### Additional information As you can see, all that's shown is an unclear error message with a location as a line number. It happens that this line number was the correct one, but is located within the action, which might not be clear enough when it's in the middle of many other things. It should be made more obvious this comes from within an action and which one. A clearer error message could also be nice, but I think YAML could make it quite hard to do and at the very least this kind of errors would be spotted very quickly if correctly located (action and line number).
kerem 2026-03-01 21:46:47 +03:00
Author
Owner

@github-actions[bot] commented on GitHub (Sep 17, 2023):

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

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

@Porkepix commented on GitHub (Sep 17, 2023):

Probably still relevant issue.

<!-- gh-comment-id:1722413970 --> @Porkepix commented on GitHub (Sep 17, 2023): Probably still relevant issue.
Author
Owner

@github-actions[bot] commented on GitHub (Mar 16, 2024):

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

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

@Porkepix commented on GitHub (Mar 16, 2024):

Probably still relevant.

<!-- gh-comment-id:2001718817 --> @Porkepix commented on GitHub (Mar 16, 2024): Probably still relevant.
Author
Owner

@github-actions[bot] commented on GitHub (Sep 13, 2024):

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

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

@Porkepix commented on GitHub (Sep 13, 2024):

Not using act currently, so I can't check if the issue is still around.
This issue doesn't seems to attract much attention though, so I guess next time I should just let the bot close it, and therefore without commenting despite checking the issue.

<!-- gh-comment-id:2350122096 --> @Porkepix commented on GitHub (Sep 13, 2024): Not using `act` currently, so I can't check if the issue is still around. This issue doesn't seems to attract much attention though, so I guess next time I should just let the bot close it, and therefore without commenting despite checking the issue.
Author
Owner

@github-actions[bot] commented on GitHub (Mar 26, 2025):

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

<!-- gh-comment-id:2752814325 --> @github-actions[bot] commented on GitHub (Mar 26, 2025): 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#837
No description provided.