appleboy / appleboy/ssh-action
return variable from ssh script to next step
- Dominant language
- Shell
- Stars
- 6.2k
- Forks
- 679
- Avg merge
- 35m
- Merged PRs (30d)
- 1
Description
I want to run an ssh script that returns a value -> res=$(ssh USER@HOST "echo 'test'")
Is this possible?
```
name: variable test
on: push
jobs:
prisma-migrate:
runs-on: ubuntu-latest
steps:
- name: set variable from remote host
id: var
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
key: ${{ secrets.KEY}}
script: |
value="test"
echo ::set-output name=res::"$value"
- name: test postgres_cluster
run: echo "${{ steps.var.outputs.res }}"
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.