【问题标题】:Github Actions cloning could not read usernameGithub Actions 克隆无法读取用户名
【发布时间】:2021-11-29 20:57:43
【问题描述】:

我有以下 Github Actions 工作流程,我想生成 Python 文档并上传到 Github Pages:

name: documentation

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      # Standard drop-in approach that should work for most people.
      - uses: ammaraskar/sphinx-action@master
        with:
          docs-folder: "docs/"
      # Publish built docs to gh-pages branch.
      # ===============================
      - name: Commit documentation changes
        run: |
          git clone https://github.com/<user>/<repo>.git --branch gh-pages --single-branch gh-pages
          cp -r docs/_build/html/* gh-pages/
          cd gh-pages
          touch .nojekyll
          git config --local user.email "<email>"
          git config --local user.name "<user>"
          git add .
          git commit -m "Update documentation" -a || true
          # The above command will fail if no changes were present, so we ignore
          # that.
      - name: Push changes
        uses: ad-m/github-push-action@master
        with:
          branch: gh-pages
          directory: gh-pages
          github_token: ${{ secrets.GITHUB_TOKEN }}
    # ===============================

但是,它总是出错:

Cloning into 'gh-pages'...
fatal: could not read Username for 'https://github.com': No such device or address

我是 Github Actions 的新手——我应该在 clone 命令之前运行一些东西吗?我是从sphinx-action-test repo 拿来的。

【问题讨论】:

标签: github-pages github-actions


【解决方案1】:

我的答案是here。看起来动作无法处理 tty 输入并抛出错误

【讨论】:

    猜你喜欢
    • 2021-12-21
    • 2016-09-25
    • 2021-01-28
    • 2016-10-09
    • 1970-01-01
    • 2022-08-08
    • 2020-06-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多