docs: add Pass environment variable to shell script

This commit is contained in:
Bo-Yi Wu 2019-09-29 11:23:40 +08:00
parent 480ff5e05e
commit ef697c0ac1

View file

@ -109,3 +109,21 @@ Multiple Hosts
whoami whoami
ls -al ls -al
``` ```
Pass environment variable to shell script
```diff
- name: pass environment
uses: appleboy/ssh-action@master
+ env:
+ FOO: "BAR"
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
+ envs: FOO
script: |
echo "I am $FOO"
echo "I am $BAR"
```