简体   繁体   中英

Where actually is the syntax error in my github actions yml file

I am actually implementing CI/CD for my application. I want to start the application automatically using pm2. So I am getting the syntax error on line 22.

This is my yml file在此处输入图像描述

This is the error I am getting on 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.

Here, from line 22, you used something like this:

- name: ...
  - run: ...
  - run: ...
  - run: ...

So there are two problems:

  • First, the name and the run field aren't at the same yaml level.
  • Second, your step with the name field doesn't have a run or uses field associated with it (you need at least one of them).

The correct syntax should be:

- name: ...
  run: ...
- run: ...
- run: ...

Reference about workflow syntax

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM