在使用操作时,如何让Yocto构建访问私有GitHub回购?

在使用操作时,如何让Yocto构建访问私有GitHub回购?,github,yocto,github-actions,Github,Yocto,Github Actions,在我的工作流程中,我可以很好地克隆repo和子模块,然后开始构建,但当从我们的GitHub私有repo运行的配方运行时,我会得到一个错误(所有的repo都是同一组织中彼此对等的)。请注意,从Internet克隆的配方运行良好,当我在本地克隆和构建时,它构建良好。当我使用GitHub操作时,我得到了以下错误 Cloning into bare repository '/home/runner/yocto_cache/downloads/git2/github.com.xxxxx.yyyyy.git

在我的工作流程中,我可以很好地克隆repo和子模块,然后开始构建,但当从我们的GitHub私有repo运行的配方运行时,我会得到一个错误(所有的repo都是同一组织中彼此对等的)。请注意,从Internet克隆的配方运行良好,当我在本地克隆和构建时,它构建良好。当我使用GitHub操作时,我得到了以下错误

Cloning into bare repository '/home/runner/yocto_cache/downloads/git2/github.com.xxxxx.yyyyy.git'...
fatal: could not read Username for 'https://github.com': No such device or address
食谱就像

SRC_URI = "git://github.com/xxxxx/yyyyy.git;protocol=https;nobranch=1;subpath=<folder>/<folder>;rev=${BUILD_REV}"
SRC_URI=”git://github.com/xxxxx/yyyyy.git;protocol=https;nobranch=1;subpath=/;rev=${BUILD_rev}”
工作流程

  build:
    runs-on: ubuntu-latest
    steps:  
    - uses: actions/checkout@v2
      with:
        token: ${{ secrets.REPO_ACCESS }}
        submodules: recursive
    
    - name: Configure Git
      run: |
        git config --unset-all "http.https://github.com/.extraheader"
        git config --add "http.https://github.com/.extraheader" "AUTHORIZATION: \ 
            Basic $(base64 <<< ${{ secrets.REPO_ACCESS }}:x-oauth-basic)"
               
    - name: Running on VM
      env:
        CC: gcc-9
      run: |
        sudo apt-get install -y diffstat
        gcc --version
        ./yocto-setup.sh
        source ./poky/oe-init-build-env
        bitbake image
构建:
运行于:ubuntu最新版本
步骤:
-用途:行动/checkout@v2
与:
令牌:${secrets.REPO_ACCESS}
子模块:递归
-名称:配置Git
运行:|
git config--取消设置所有“http”。https://github.com/.extraheader"
git config——添加“http。https://github.com/.extraheader“”授权:

从错误消息判断,基本$(base64

为了克服这个问题,如果您想通过HTTP(S)协议访问您的私有Git存储库,而不在终端输入上提供凭据,那么您必须配置
Git
,以便在HTTP请求中包含头

可以使用配置身份验证标头。您可以直接在
构建
作业中执行此操作,只需在虚拟机上运行
之前添加此额外步骤即可:

-名称:配置Git
运行:|
git config--取消设置所有“http”。https://github.com/.extraheader"
git config——添加“http。https://github.com/.extraheader" \

“授权:Basic$(base64)仍然失败。使用建议的工作流更新更新了原始版本更改后的错误消息是什么?与问题中描述的相同?是。这仍然失败,如所述。”。 fatal: could not read Username for 'https://github.com': No such device or address No such device or address