首页 > 解决方案 > 无法解析主机名:从 CircleCI 作业推送到 Github 私人仓库时

问题描述

我正在研究 Github-CircleCI 集成。我的一项工作是将 git 标签推送到同一个存储库。但是每次我尝试这样做时,都会收到以下错误:

    ssh: Could not resolve hostname : Name or service not known

    fatal: Could not read from remote repository.

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

我按照文档https://circleci.com/docs/2.0/gh-bb-integration/#creating-a-github-deploy-key中提到的步骤进行操作。但这不起作用。我确保我对我的新部署密钥具有写入权限。我还在我的 yml 文件中添加了指纹。

version: 2.0
jobs:
  deploy:
    steps:
      - add_ssh_keys:
          fingerprints:
            - "<FINGERPRINT>"
      - checkout
      - run:
          name: deploy
          command: |
                  git tag -a v1.0.0 -m "test tag"
                  echo "tag created"
                  git push origin v1.0.0
                  echo "tag pushed"

workflows:
  version: 2
  build-and-deploy:
    jobs:
      - deploy:
          filters:
             branches:
              only:
                - /^test/

我成功创建了标签。但是每当它尝试推送标签时,它就会出现上述错误。

谁能指出丢失的东西?任何帮助表示赞赏!

标签: gitgithubcircleci-2.0

解决方案


推荐阅读