From 49e81b4a325eb2ec4c1c48f5800d1c73410e5d93 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 29 Sep 2019 12:02:21 +0800 Subject: [PATCH] docs: add stop script if command error --- .github/workflows/ci.yml | 18 +++++++++--------- README.md | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b867cb..5b39ee3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,15 +35,15 @@ jobs: whoami ls -al - - name: stop script if command error - uses: appleboy/ssh-action@master - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.KEY }} - port: ${{ secrets.PORT }} - script_stop: true - script: "mkdir abc/def,ls -al" + # - name: stop script if command error + # uses: appleboy/ssh-action@master + # with: + # host: ${{ secrets.HOST }} + # username: ${{ secrets.USERNAME }} + # key: ${{ secrets.KEY }} + # port: ${{ secrets.PORT }} + # script_stop: true + # script: "mkdir abc/def,ls -al" - name: pass environment uses: appleboy/ssh-action@master diff --git a/README.md b/README.md index cfbed95..3fd3ff0 100644 --- a/README.md +++ b/README.md @@ -126,3 +126,17 @@ Pass environment variable to shell script echo "I am $FOO" echo "I am $BAR" ``` + +Stop script after first failure. ex: missing `abc` folder + +```yaml +- name: stop script if command error + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.KEY }} + port: ${{ secrets.PORT }} + script_stop: true + script: "mkdir abc/def,ls -al" +```