[英]Where actually is the syntax error in my github actions yml file
I am actually implementing CI/CD for my application.我实际上正在为我的应用程序实施 CI/CD。 I want to start the application automatically using pm2.
我想使用 pm2 自动启动应用程序。 So I am getting the syntax error on line 22.
所以我在第 22 行收到语法错误。
This is my yml file这是我的 yml 文件
This is the error I am getting on github这是我在 github 上遇到的错误
The problem in the syntax here is related to how you used the -
symbol.这里的语法问题与您如何使用
-
符号有关。
With Github actions, you need at least a run
or uses
field inform for each step inside your job, at the same level of the name
field (which is not mandarory), otherwise the github interpreter will return an error.使用 Github 操作,您的作业中的每个步骤至少需要
run
或uses
字段通知,在name
字段的同一级别(不是强制性的),否则 github 解释器将返回错误。
Here, from line 22, you used something like this:在这里,从第 22 行开始,您使用了如下内容:
- name: ...
- run: ...
- run: ...
- run: ...
So there are two problems:所以有两个问题:
name
and the run
field aren't at the same yaml level.name
和run
字段不在同一个 yaml 级别。name
field doesn't have a run
or uses
field associated with it (you need at least one of them).name
字段的步骤没有与之关联的run
或uses
字段(您至少需要其中一个)。 The correct syntax should be:正确的语法应该是:
- name: ...
run: ...
- run: ...
- run: ...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.