actions / checkout

Action for checking out a repo
https://github.com/features/actions
MIT License
5.94k stars 1.77k forks source link

Unable to locate executable file: ssh #1942

Open ndlanier opened 1 month ago

ndlanier commented 1 month ago

Thank you 🙇‍♀ for wanting to create an issue in this repository. Before you do, please ensure you are filing the issue in the right place. Issues should only be opened on if the issue relates to code in this repository.

If your issue is relevant to this repository, please delete this text and continue to create this issue. Thank you in advance.

Using the checkout action to pull a dependency repository via ssh

- name: Checkout common-modules@${{ steps.set_versions.outputs.MODULE_VERSION }}
      uses: actions/checkout@v4.2.0
      if: steps.set_versions.outputs.MODULE_APPS && steps.run_condition.outputs.RUN_CONDITION
      with:
        repository: ${{ inputs.COMMON_MODULE_REPO }}
        ssh-key: ${{ secrets.COMMON_MODULE_SSH }}
        ref: ${{ steps.set_versions.outputs.MODULE_VERSION }}
        path: common_modules

I am seeing the following error: Error: Unable to locate executable file: ssh. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.

We have changed the version we are using back and forth and are still having the issue. Is the image it's pulling missing the ssh executable or is this a misleading error?

luisg0nc commented 2 weeks ago

Hello @ndlanier

Having the same issue and was able to pin point that this seems to happen only on self-hosted runners due to missing ssh-agent. Using ubuntu-latest and it works.

Check this issue: https://github.com/actions/runner/issues/3490