Skip to content

Duplicated output capture on the latest (1.2.3) version. #397

@complynx

Description

@complynx

Describe the bug

I'm using capture_stdout, and prior to 1.2.3, it was captured only once, but latest duplicates output.

Yaml Config

jobs:
  run-script:
    runs-on: ubuntu-latest
    outputs:
      stdout: ${{ steps.set-output.outputs.stdout }}
    steps:
      - name: Run script on complynx.net
        id: run-script
        uses: appleboy/ssh-action@v1.2.2
        env:
          ...
        with:
          host: complynx.net
          username: complynx
          key: ${{ secrets.SERVER_SSH_KEY }}
          capture_stdout: ${{ inputs.capture_stdout }}
          command_timeout: 60m
          envs: >
             ...
          script: ${{ inputs.script }}
      - name: Set output
        if: ${{ inputs.capture_stdout }}
        run: |
          echo "${{ steps.run-script.outputs.stdout }}"|grep -v 'output: '
          output_filtered=$(echo "${{ steps.run-script.outputs.stdout }}" | grep 'output: ' | sed 's/^output: //')
          echo "stdout=$output_filtered" >> $GITHUB_OUTPUT
        id: set-output

latest:
Image

1.2.2:
Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions