我们有一个 GitHub Action 来构建我们的应用程序 我们正在使用多行语法。
run: |
npm install
npm run test
npm run e2e
npm run deploy
如果其中一个命令失败,则继续执行下一个命令并部署应用程序。
有没有办法在第一次失败时中止操作?
最佳答案
您应该尝试“与”运算符 (&&):
run: |
npm install &&
npm run test &&
npm run e2e &&
npm run deploy
关于github-actions - 在第一次失败时停止多行 GitHub 操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62996357/