mirror of
https://github.com/nektos/act.git
synced 2026-04-26 01:15:51 +03:00
[GH-ISSUE #1605] Some formating yaml syntax errors can result in a complete Go crash #805
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#805
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Porkepix on GitHub (Feb 3, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1605
Bug report info
Command used with act
Describe issue
A slight error in the
yamlof an action can cause a complete Go panicLink to GitHub repository
No response
Workflow content
This is action content, not workflow. You just need to call whatever action containing this mistake.
As explained below, the same mistake is caught if present in a workflow file.
Relevant log output
Additional information
The error happened on a slight error in an action I was working on: a dash arrived on a
uses:line while there was already a- name:on top of it.The same mistake is caught for workflows so the panic only happens for actions.
In workflows we get something like this:
Error: Invalid run/uses syntax for job:foo step:bar@KnisterPeter commented on GitHub (Feb 6, 2023):
Just run https://github.com/rhysd/actionlint right before calling
actand you are good to go.@Porkepix commented on GitHub (Feb 6, 2023):
@KnisterPeter Yes linting is always a good idea. However, I don't think a complete crash of the program is something that should be considered as a normal behavior, even if this is due to a user's mistake.
Note that the same mistake is caught when done in the workflow file, as mentioned at the end of my message.
I believe the same kind of mistake should be handled the same way and caught the same way for actions as it's already done for workflows, wouldn't you agree?
@KnisterPeter commented on GitHub (Feb 6, 2023):
Given that an invalid yaml file is syntactic garbage I'm not sure if I would agree. It might be good to not just panic, but the result would be the exact same as of now.
But feel free to provide a pull request with a fix for this. We are happy for every contribution.
@ChristopherHX commented on GitHub (Feb 6, 2023):
@KnisterPeter actionlint doesn't support composite actions. We should fix crashs in act.
I add it to my backlog for act.
@ChristopherHX commented on GitHub (Feb 6, 2023):
You get now Invalid run/uses syntax for job:composite-job step:Foo for local actions. Your remote action example is now a failure instead of a crash, without more information.
@Porkepix commented on GitHub (Feb 6, 2023):
Yes, I think providing an accurate explanation of the problem would mean analyzing deeply the file and basically reimplement most of the features of a linter.
The most important is to not get a crash, and at the very least the message is clear enough the yaml file have an issue and is malformed: with the crash it took me some time to figure out the issue was on my end and that my yaml file was malformed.