Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return variable from ssh script to next step #143

Open
nickagel opened this issue Dec 1, 2021 · 1 comment
Open

return variable from ssh script to next step #143

nickagel opened this issue Dec 1, 2021 · 1 comment
Labels

Comments

@nickagel
Copy link

nickagel commented Dec 1, 2021

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 }}"
@MakhouT
Copy link

MakhouT commented Mar 21, 2024

Ever found a solution for this?

@appleboy appleboy added the enhancement New feature or request label Mar 21, 2024
@appleboy appleboy added feature and removed enhancement New feature or request labels Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants