mirror of
https://gitea.com/actions/appleboy-ssh-action.git
synced 2024-11-23 02:29:37 +01:00
docs: add stop script if command error
This commit is contained in:
parent
04535147e0
commit
49e81b4a32
2 changed files with 23 additions and 9 deletions
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
|
@ -35,15 +35,15 @@ jobs:
|
||||||
whoami
|
whoami
|
||||||
ls -al
|
ls -al
|
||||||
|
|
||||||
- name: stop script if command error
|
# - name: stop script if command error
|
||||||
uses: appleboy/ssh-action@master
|
# uses: appleboy/ssh-action@master
|
||||||
with:
|
# with:
|
||||||
host: ${{ secrets.HOST }}
|
# host: ${{ secrets.HOST }}
|
||||||
username: ${{ secrets.USERNAME }}
|
# username: ${{ secrets.USERNAME }}
|
||||||
key: ${{ secrets.KEY }}
|
# key: ${{ secrets.KEY }}
|
||||||
port: ${{ secrets.PORT }}
|
# port: ${{ secrets.PORT }}
|
||||||
script_stop: true
|
# script_stop: true
|
||||||
script: "mkdir abc/def,ls -al"
|
# script: "mkdir abc/def,ls -al"
|
||||||
|
|
||||||
- name: pass environment
|
- name: pass environment
|
||||||
uses: appleboy/ssh-action@master
|
uses: appleboy/ssh-action@master
|
||||||
|
|
14
README.md
14
README.md
|
@ -126,3 +126,17 @@ Pass environment variable to shell script
|
||||||
echo "I am $FOO"
|
echo "I am $FOO"
|
||||||
echo "I am $BAR"
|
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"
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in a new issue