ssh-agent icon indicating copy to clipboard operation
ssh-agent copied to clipboard

ssh-agent is not working properly with msys2/setup-msys2

Open mojca opened this issue 3 years ago • 2 comments

I cannot get the ssh-agent working in combination with https://github.com/msys2/setup-msys2

Cloning into 'private-repository-I-fetch-via-cmake-fetchcontent'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Example workflow:

name: Test

on:
  push:

jobs:
  build-mingw-windows:
    runs-on: windows-2022
    name: Windows MinGW Clang

    strategy:
      matrix:
        include:
          - cmake_generator: Ninja
            cmake_defines: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
            mingw_msystem: mingw64
            mingw_env: x86_64

    # didn't work as advertised
    #defaults:
    #  run:
    #    shell: msys2 {0}

    steps:
      - name: Setup MinGW, install dependencies
        uses: msys2/setup-msys2@v2
        with:
          update: true
          msystem: ${{ matrix.mingw_msystem }}
          # not sure which ones are really needed
          install: >-
            git
            ninja
          pacboy: >-
            cmake:p
            clang:p

      - name: Checkout
        uses: actions/checkout@v3

      - uses: webfactory/[email protected]
        with:
          ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

      # requires some private dependencies via CMake's FetchContents
      - name: Configure
        shell: msys2 {0}
        run: |
          mkdir build
          cd build
          cmake -G "${{ matrix.cmake_generator }}" --preset ${{ env.cmake_preset }} ${{ matrix.cmake_defines }} ..

mojca avatar Nov 08 '22 08:11 mojca

Maybe it has to do with shell: msys2 {0}? Just a wild guess.

Can anybody help?

mpdude avatar Jan 27 '23 17:01 mpdude

The error message seems to say that the Keys are not properly set up:

Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Maybe try first, if they are ok ...

wblessen avatar Mar 02 '23 09:03 wblessen