easingthemes / ssh-deploy

GitHub Action for deploying code via rsync over ssh. (with NodeJS)
MIT License
1.17k stars 144 forks source link

MS VS code editor error #129

Closed altrusl closed 1 year ago

altrusl commented 1 year ago

MS VS code with GitHub Actions extension gives an error for this action:

Missing required inputs: SSH_PRIVATE_KEY, REMOTE_HOST, REMOTE_USER

error-screenshot

No errors if i replace env with with

altrusl commented 1 year ago

I managed to fix it with this structure

      - name: Transfer files
        uses: easingthemes/ssh-deploy@main
        with:
          SSH_PRIVATE_KEY: ${{ env.SSH_PRIVATE_KEY }}
          REMOTE_HOST: ${{ env.HOST }}
          REMOTE_USER: ${{ env.REMOTE_USER }}
        env:
          SOURCE: "dist/"
          TARGET: ${{ env.TARGET_DIR }}
          EXCLUDE: ".git, .github, .vscode, *.md, *.yaml, *.sql, .gitignore"

If i use only with the transfer fails (finishes successfully but the files are not actually transfered)

bensandee commented 1 year ago

I see this too. In https://github.com/easingthemes/ssh-deploy/blob/main/src/inputs.js

const inputVal = process.env[input] || process.env[`INPUT_${input}`] || defaultInputs[inputName];

I wonder if the INPUT environment variable should be prioritized over the general env variable, like this:

const inputVal = process.env[`INPUT_${input}`] || process.env[input] || defaultInputs[inputName];

It could be that your environment has some of those values defined already and they are taking priority.

bensandee commented 1 year ago

FWIW, in my setup I was able to simply swap with for env and it worked, but like I said above, if your environment has some clashes then I could see a case where it would fail in strange ways.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.