appleboy / ssh-action

GitHub Actions for executing remote ssh commands.
https://github.com/marketplace/actions/ssh-remote-commands
MIT License
4.85k stars 578 forks source link

feature request: pass common options via variables/secrets by default #310

Open nicola-lunghi opened 7 months ago

nicola-lunghi commented 7 months ago

Hi,

it is possible to have a more compact syntax for this action?

I have multiple steps that needs to be executed in sequence

   - uses: actions/appleboy/ssh-action@v1.0.3
        with:
          host: ${{ env.SSH_HOST }}
          username: ${{ env.SSH_USER }}
          key: ${{ secrets.TESTHOST_SSH_KEY }}
          script: ./step1.sh
   - uses: actions/appleboy/ssh-action@v1.0.3
        with:
          host: ${{ env.SSH_HOST }}
          username: ${{ env.SSH_USER }}
          key: ${{ secrets.TESTHOST_SSH_KEY }}
          script: ./step3.sh
   - uses: actions/appleboy/ssh-action@v1.0.3
        with:
          host: ${{ env.SSH_HOST }}
          username: ${{ env.SSH_USER }}
          key: ${{ secrets.TESTHOST_SSH_KEY }}
          script: ./step4.sh

I want to split the steps as I want to see the failure on the specific step. There's a way to define the host, username, key once and for all? or can I for example add the ssh key to the ssh config of the host?

Thanks, Nick