代码之家  ›  专栏  ›  技术社区  ›  Ivan Beldad

Travis无法使用令牌从github存储库中提取

  •  0
  • Ivan Beldad  · 技术社区  · 8 年前

    我创建了一个github令牌,以便使用travis ci自动部署。

    我正在本地环境中使用这个令牌来测试它。我就是这么做的:

    mkdir out && cd out
    git init
    git remote add origin https://$USERNAME:$GITHUB_TOKEN@github.com/$USERNAME/$PROJECT
    git pull --all
    

    这在我自己的计算机中就像一个魔咒,但在travis中执行时,我得到的唯一输出是:

    Initialized empty Git repository in /home/travis/build/$USERNAME/$PROJECT/out/.git/
    Fetching origin
    remote: Not found
    fatal: repository 'https://[secure]@github.com/$USERNAME/$PROJECT/' not found
    error: Could not fetch origin
    

    我错过了什么?

    1 回复  |  直到 8 年前
        1
  •  0
  •   Ivan Beldad    8 年前

    我不知道原因,但url必须以 .git

    断开的URL: https://username:token@github.com/username/project

    固定URL..: https://username:token@github.com/username/project.git