docs: add stop script if command error

This commit is contained in:
Bo-Yi Wu 2019-09-29 12:02:21 +08:00
parent 04535147e0
commit 49e81b4a32
2 changed files with 23 additions and 9 deletions

View File

@ -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

View File

@ -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"
```