Skip to content

return variable from ssh script to next step  #143

Open
@nickagel

Description

@nickagel

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 }}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions