Github操作:由于服务器指纹,xcodebuild失败 [英] Github Actions: xcodebuild fails due to server fingerprint

查看:41
本文介绍了Github操作:由于服务器指纹,xcodebuild失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Github Actions构建一个macOS应用.在我将依赖项迁移到Swift Package Manager之前,这已经很好地工作了.现在,在构建应用程序时出现以下错误:

I am trying to build a macOS app with Github Actions. This already worked very well, until I migrated my dependencies to Swift Package Manager. Now I am getting the following error while building my app:

xcodebuild:错误:无法解决程序包依赖性:服务器SSH指纹无法验证.

在我的应用程序中,我有一个私有的GitHub存储库作为依赖项,使用ssh位置添加为Swift软件包.因此,我需要在设置ssh-agent 步骤中为依赖项添加ssh密钥.使用 git clone 在一个步骤中手动克隆存储库工作正常,但我需要使其与xcodebuild一起使用才能成功构建我的应用程序.

I have a private GitHub repository as a dependeny in my application added as a Swift Package using a ssh location. Therefore I need to add my ssh key for the dependency in the Set up ssh-agent step. Manually cloning the repository in a step using git clone is working fine but I need to get it work with xcodebuild in order to successfully build my app.

name: Main
on:
  push:
    tags:
      - 'v*.*.*'

jobs:
  build:
    name: Release
    runs-on: macOS-latest
    steps:
      - name: Checkout
        uses: actions/checkout@master
        with:
          fetch-depth: 1
      - name: Set up ssh-agent
        uses: yakuhzi/action-ssh-agent@v1
        with:
          public: ${{ secrets.SSH_PUBLIC_KEY }}
          private: ${{ secrets.SSH_PRIVATE_KEY }}
      - name: Build application
        run: |
          sudo xcode-select -switch /Applications/Xcode_11.app
          xcodebuild -project Application.xcodeproj -scheme Application -configuration Release -derivedDataPath $HOME/Application build

推荐答案

最后我弄清楚了.看来这是Xcode 11中的一个已知问题( https://developer.apple.com/documentation/xcode_release_notes/xcode_11_release_notes ).

Finally I figured it out. It seems like its a known issue in Xcode 11 (https://developer.apple.com/documentation/xcode_release_notes/xcode_11_release_notes).

在本文中感谢Dosium( https://discuss.bitrise.io/t/xcode-11-resolving-packages-fails-with-ssh-fingerprint/10388 ),我就能使其正常工作.

Thanks to Dosium in this post (https://discuss.bitrise.io/t/xcode-11-resolving-packages-fails-with-ssh-fingerprint/10388), I was able to get it work.

解决方案是在运行xcodebuild之前运行以下命令: for IP in $(挖@ 8.8.8.8 github.com + short);做ssh-keyscan github.com,$ ip;ssh-keyscan $ ip;完成2>/dev/null>>〜/.ssh/known_hosts

The solution is to run the following command before running xcodebuild: for ip in $(dig @8.8.8.8 github.com +short); do ssh-keyscan github.com,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts

这篇关于Github操作:由于服务器指纹,xcodebuild失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆