[GH-ISSUE #12] "panic:unquote err: invalid syntax" thrown when parsing args whose value is a regex #8

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

Originally created by @francisfuzz on GitHub (Jan 18, 2019).
Original GitHub issue: https://github.com/nektos/act/issues/12

👋 @cplee –– thank you for creating this project!

A workflow file containing an action whose args specify a REGEX will throw a "panic:unquote err: invalid syntax" error.

Looking at previously reported issues, https://github.com/nektos/act/issues/4 was the most similar report raised for this kind of error.

example.workflow file

workflow "New workflow" {
  on = "push"
  resolves = ["filter-version-before-deploy"]
}

action "filter-version-before-deploy" {
  uses = "actions/bin/filter@master"
  args = "tag v?[0-9]+\\.[0-9]+\\.[0-9]+"
}

Running act -l on this file with verbose output enabled

act -f example.workflow -lv
DEBU[0000] Setting working dir to /path/to/repo/.github 
DEBU[0000] Loading workflow config from /path/to/repo/.github/example.workflow 
DEBU[0000] Parsed literal "tag v?[0-9]+\\.[0-9]+\\.[0-9]+" to list ["tag" "v?[0-9]+\\.[0-9]+\\.[0-9]+"] 
panic: unquote "v?[0-9]+\.[0-9]+\.[0-9]+" err: invalid syntax
Expand for remaining verbose output
goroutine 1 [running]:
github.com/hashicorp/hcl/hcl/token.Token.Value(0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc000020300, 0x1a, 0x0, 0x105060d, ...)
	/Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/hcl/token/token.go:162 +0x59e
github.com/hashicorp/hcl.(*decoder).decodeString(0xc0001efa60, 0xc0000281b0, 0x30, 0x1810040, 0xc0000587e0, 0x165a9c0, 0xc00004c850, 0x198, 0x0, 0xc0001ee2f0)
	/Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:530 +0x2c5
github.com/hashicorp/hcl.(*decoder).decode(0xc0001efa60, 0xc0000281b0, 0x30, 0x1810040, 0xc0000587e0, 0x165a9c0, 0xc00004c850, 0x198, 0x0, 0x0)
	/Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:106 +0x7e5
github.com/hashicorp/hcl.(*decoder).decodeSlice(0xc0001efa60, 0xc000028150, 0x2d, 0x1810000, 0xc000316230, 0x16508a0, 0xc0003221c0, 0x197, 0xc0001ee568, 0xc0001ee568)
	/Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:459 +0x46d
github.com/hashicorp/hcl.(*decoder).decode(0xc0001efa60, 0xc000028150, 0x2d, 0x1810000, 0xc000316230, 0x16508a0, 0xc0003221c0, 0x197, 0x0, 0x0)
	/Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:104 +0x881
github.com/hashicorp/hcl.(*decoder).decodeStruct(0xc0001efa60, 0xc0000280f0, 0x28, 0x1810100, 0xc000058540, 0x1717ca0, 0xc000322180, 0x199, 0x0, 0xc0001eeda0)
	/Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:702 +0x1536
github.com/hashicorp/hcl.(*decoder).decode(0xc0001efa60, 0xc0000280f0, 0x28, 0x1810140, 0xc000058540, 0x1717ca0, 0xc000322180, 0x199, 0x0, 0x0)
	/Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:108 +0x749
github.com/hashicorp/hcl.(*decoder).decodeMap(0xc0001efa60, 0xc000022280, 0xb, 0x1810100, 0xc00000a6a0, 0x1686900, 0xc00001c278, 0x195, 0xc0001ef1b8, 0xc0001ef1b8)
	/Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:386 +0x696
github.com/hashicorp/hcl.(*decoder).decode(0xc0001efa60, 0xc000022280, 0xb, 0x1810100, 0xc00000a6a0, 0x1686900, 0xc00001c278, 0x195, 0x0, 0x0)
	/Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:100 +0x5f3
github.com/hashicorp/hcl.(*decoder).decodeStruct(0xc0001efa60, 0x175b303, 0x4, 0x1810100, 0xc00000a1a0, 0x170e280, 0xc00001c240, 0x199, 0x0, 0x0)
	/Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:692 +0x1749
github.com/hashicorp/hcl.(*decoder).decode(0xc0001efa60, 0x175b303, 0x4, 0x1810100, 0xc00000a1a0, 0x170e280, 0xc00001c240, 0x199, 0x0, 0x0)
	/Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:108 +0x749
github.com/hashicorp/hcl.DecodeObject(0x17149a0, 0xc00001c240, 0x1810100, 0xc00000a1a0, 0xc00000a1a0, 0x0)
	/Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:60 +0x16d
github.com/nektos/act/actions.parseWorkflowsFile(0x180e000, 0xc00000c030, 0xc00000c030, 0x0, 0x0)
	/Users/casey.lee/Dev/personal/act/actions/parser.go:68 +0x166
github.com/nektos/act/actions.ParseWorkflows(0xc000024180, 0x39, 0xc0000261e0, 0x4a, 0xc000314000, 0xc0001efc18, 0x15e1d13, 0xc000314000)
	/Users/casey.lee/Dev/personal/act/actions/parser.go:35 +0x1f9
github.com/nektos/act/cmd.newRunAction.func1(0xc000312000, 0xc00031a0c0, 0x0, 0x3, 0x0, 0x0)
	/Users/casey.lee/Dev/personal/act/cmd/root.go:53 +0xae
github.com/spf13/cobra.(*Command).execute(0xc000312000, 0xc000084090, 0x3, 0x3, 0xc000312000, 0xc000084090)
	/Users/casey.lee/Dev/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:762 +0x473
github.com/spf13/cobra.(*Command).ExecuteC(0xc000312000, 0x1, 0x1760e3c, 0x11)
	/Users/casey.lee/Dev/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:852 +0x2fd
github.com/spf13/cobra.(*Command).Execute(0xc000312000, 0x1cab590, 0x175cf78)
	/Users/casey.lee/Dev/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:800 +0x2b
github.com/nektos/act/cmd.Execute(0x1814b40, 0xc0001f5880, 0x1807a90, 0x5)
	/Users/casey.lee/Dev/personal/act/cmd/root.go:41 +0x423
main.main()
	/Users/casey.lee/Dev/personal/act/main.go:33 +0x167

While I don't have a complete understanding for how things really work under the hood, I see that the parsed literal is logged in parseCommand:

github.com/nektos/act@36303ce43d/actions/parser.go (L136)

parseCommand is called in this block:

github.com/nektos/act@36303ce43d/actions/parser.go (L51)

Originally created by @francisfuzz on GitHub (Jan 18, 2019). Original GitHub issue: https://github.com/nektos/act/issues/12 👋 @cplee –– thank you for creating this project! ✨ A workflow file containing an action whose args specify a REGEX will throw a "panic:unquote err: invalid syntax" error. Looking at previously reported issues, https://github.com/nektos/act/issues/4 was the most similar report raised for this kind of error. #### `example.workflow` file ```workflow workflow "New workflow" { on = "push" resolves = ["filter-version-before-deploy"] } action "filter-version-before-deploy" { uses = "actions/bin/filter@master" args = "tag v?[0-9]+\\.[0-9]+\\.[0-9]+" } ``` #### Running `act -l` on this file with verbose output enabled ```shell act -f example.workflow -lv DEBU[0000] Setting working dir to /path/to/repo/.github DEBU[0000] Loading workflow config from /path/to/repo/.github/example.workflow DEBU[0000] Parsed literal "tag v?[0-9]+\\.[0-9]+\\.[0-9]+" to list ["tag" "v?[0-9]+\\.[0-9]+\\.[0-9]+"] panic: unquote "v?[0-9]+\.[0-9]+\.[0-9]+" err: invalid syntax ``` <details> <summary>Expand for remaining verbose output</summary> ```golang goroutine 1 [running]: github.com/hashicorp/hcl/hcl/token.Token.Value(0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc000020300, 0x1a, 0x0, 0x105060d, ...) /Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/hcl/token/token.go:162 +0x59e github.com/hashicorp/hcl.(*decoder).decodeString(0xc0001efa60, 0xc0000281b0, 0x30, 0x1810040, 0xc0000587e0, 0x165a9c0, 0xc00004c850, 0x198, 0x0, 0xc0001ee2f0) /Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:530 +0x2c5 github.com/hashicorp/hcl.(*decoder).decode(0xc0001efa60, 0xc0000281b0, 0x30, 0x1810040, 0xc0000587e0, 0x165a9c0, 0xc00004c850, 0x198, 0x0, 0x0) /Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:106 +0x7e5 github.com/hashicorp/hcl.(*decoder).decodeSlice(0xc0001efa60, 0xc000028150, 0x2d, 0x1810000, 0xc000316230, 0x16508a0, 0xc0003221c0, 0x197, 0xc0001ee568, 0xc0001ee568) /Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:459 +0x46d github.com/hashicorp/hcl.(*decoder).decode(0xc0001efa60, 0xc000028150, 0x2d, 0x1810000, 0xc000316230, 0x16508a0, 0xc0003221c0, 0x197, 0x0, 0x0) /Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:104 +0x881 github.com/hashicorp/hcl.(*decoder).decodeStruct(0xc0001efa60, 0xc0000280f0, 0x28, 0x1810100, 0xc000058540, 0x1717ca0, 0xc000322180, 0x199, 0x0, 0xc0001eeda0) /Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:702 +0x1536 github.com/hashicorp/hcl.(*decoder).decode(0xc0001efa60, 0xc0000280f0, 0x28, 0x1810140, 0xc000058540, 0x1717ca0, 0xc000322180, 0x199, 0x0, 0x0) /Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:108 +0x749 github.com/hashicorp/hcl.(*decoder).decodeMap(0xc0001efa60, 0xc000022280, 0xb, 0x1810100, 0xc00000a6a0, 0x1686900, 0xc00001c278, 0x195, 0xc0001ef1b8, 0xc0001ef1b8) /Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:386 +0x696 github.com/hashicorp/hcl.(*decoder).decode(0xc0001efa60, 0xc000022280, 0xb, 0x1810100, 0xc00000a6a0, 0x1686900, 0xc00001c278, 0x195, 0x0, 0x0) /Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:100 +0x5f3 github.com/hashicorp/hcl.(*decoder).decodeStruct(0xc0001efa60, 0x175b303, 0x4, 0x1810100, 0xc00000a1a0, 0x170e280, 0xc00001c240, 0x199, 0x0, 0x0) /Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:692 +0x1749 github.com/hashicorp/hcl.(*decoder).decode(0xc0001efa60, 0x175b303, 0x4, 0x1810100, 0xc00000a1a0, 0x170e280, 0xc00001c240, 0x199, 0x0, 0x0) /Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:108 +0x749 github.com/hashicorp/hcl.DecodeObject(0x17149a0, 0xc00001c240, 0x1810100, 0xc00000a1a0, 0xc00000a1a0, 0x0) /Users/casey.lee/Dev/go/pkg/mod/github.com/hashicorp/hcl@v1.0.0/decoder.go:60 +0x16d github.com/nektos/act/actions.parseWorkflowsFile(0x180e000, 0xc00000c030, 0xc00000c030, 0x0, 0x0) /Users/casey.lee/Dev/personal/act/actions/parser.go:68 +0x166 github.com/nektos/act/actions.ParseWorkflows(0xc000024180, 0x39, 0xc0000261e0, 0x4a, 0xc000314000, 0xc0001efc18, 0x15e1d13, 0xc000314000) /Users/casey.lee/Dev/personal/act/actions/parser.go:35 +0x1f9 github.com/nektos/act/cmd.newRunAction.func1(0xc000312000, 0xc00031a0c0, 0x0, 0x3, 0x0, 0x0) /Users/casey.lee/Dev/personal/act/cmd/root.go:53 +0xae github.com/spf13/cobra.(*Command).execute(0xc000312000, 0xc000084090, 0x3, 0x3, 0xc000312000, 0xc000084090) /Users/casey.lee/Dev/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:762 +0x473 github.com/spf13/cobra.(*Command).ExecuteC(0xc000312000, 0x1, 0x1760e3c, 0x11) /Users/casey.lee/Dev/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:852 +0x2fd github.com/spf13/cobra.(*Command).Execute(0xc000312000, 0x1cab590, 0x175cf78) /Users/casey.lee/Dev/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:800 +0x2b github.com/nektos/act/cmd.Execute(0x1814b40, 0xc0001f5880, 0x1807a90, 0x5) /Users/casey.lee/Dev/personal/act/cmd/root.go:41 +0x423 main.main() /Users/casey.lee/Dev/personal/act/main.go:33 +0x167 ``` </details> While I don't have a complete understanding for how things really work under the hood, I see that the parsed literal is logged in `parseCommand`: https://github.com/nektos/act/blob/36303ce43db5a716e211084c04ab0d30717cc5c1/actions/parser.go#L136 `parseCommand` is called in this block: https://github.com/nektos/act/blob/36303ce43db5a716e211084c04ab0d30717cc5c1/actions/parser.go#L51
kerem closed this issue 2026-03-01 21:39:05 +03:00
Author
Owner

@cplee commented on GitHub (Jan 18, 2019):

@francisfuzz this is now fixed on master, can you confirm? i'll cut a new release after i get your 👍

<!-- gh-comment-id:455693887 --> @cplee commented on GitHub (Jan 18, 2019): @francisfuzz this is now fixed on `master`, can you confirm? i'll cut a new release after i get your 👍
Author
Owner

@francisfuzz commented on GitHub (Jan 22, 2019):

Thanks @cplee - I've confirmed github.com/nektos/act@a04141c444 works for me locally 👍

While I appreciate testing this manually, I think a good step forward is to set up some form of automated testing for this project. Opened https://github.com/nektos/act/issues/17 for discussion ✌️

<!-- gh-comment-id:456479878 --> @francisfuzz commented on GitHub (Jan 22, 2019): Thanks @cplee - I've confirmed https://github.com/nektos/act/commit/a04141c4440be5c0f003d5441e4e2a97bc09060e works for me locally 👍 While I appreciate testing this manually, I think a good step forward is to set up some form of automated testing for this project. Opened https://github.com/nektos/act/issues/17 for discussion ✌️
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#8
No description provided.