![](/img/trans.png)
[英]error when pushing files to Git in Colab: fatal: could not read Username for 'https://github.com': No such device or address
[英]Error when cloning repo in github actions: could not read Password for 'https://***@github.com': No such device or address
我有一個名為FOO_SECRET
的存儲庫秘密(它是一個具有細粒度范圍的個人訪問令牌)
但是,以下工作流程步驟失敗
- name: clone repo
working-directory: /tmp
shell: bash
run: |
git clone \
--branch ${{ env.DEFAULT_BRANCH }} \
--single-branch \
https://${{ secrets.FOO_SECRET }}@${{ matrix.repository }}
錯誤如下
fatal: could not read Password for 'https://***@github.com': No such device or address
這是為什么?
我建議添加此步驟以配置 git 以克隆私人倉庫:
- name: Configure git for private modules
env:
GITHUB_API_TOKEN: ${{ secrets.FOO_SECRET }}
run: git config --global url."https://x:${GITHUB_API_TOKEN}@github.com".insteadOf "https://github.com"
注意:我建議你使用https://github.com/actions/checkout從 github 簽出一個 repo
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.