mirror of
https://github.com/appleboy/ssh-action.git
synced 2024-12-27 12:31:53 +08:00
docs: add Pass environment variable to shell script
This commit is contained in:
parent
480ff5e05e
commit
ef697c0ac1
18
README.md
18
README.md
@ -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"
|
||||||
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user