【问题标题】:fatal: could not read Username for 'https://github.com': invalid url致命:无法读取 \'https://github.com\' 的用户名:无效的 url
【发布时间】:2022-11-14 13:14:29
【问题描述】:

每当使用 gitaction 将某些内容推送到开发分支时,我都会尝试为我的主分支设置自动合并。这是我的 gitaction 文件:

name: Auto merge
on:
  push:
    branches:
      - development
env:
  # replace "github_username" with your GitHub username
  # replace "github.com/username/repo.git" with your GitHub repo path
  # do NOT replace ${{secrets.GITHUB_TOKEN}}, GitHub will take care of it
  MY_REPO: https://my-username:${{secrets.GITHUB_TOKEN}}@github.com/organisation-username/repo.git

  # replace "long-lived_branch_name" with your branch name  
  MY_BRANCH: development

  # replace it with the path to master repo
  MAIN_REPO: https://github.com/organisation-username/repo.git

  # replace "master" with your master branch name
  MAIN_BRANCH: main

jobs:
  merge:
    runs-on: ubuntu-latest

    steps:
    - name: Merge with master
      run: |
        git clone ${{env.MY_REPO}} -b ${{env.MY_BRANCH}} tmp
        cd tmp
        git config user.name "Automerge Bot"
        git config user.email "gcpabia@gmail.com"
        git config pull.rebase false
        git pull ${{env.MAIN_REPO}} ${{env.MAIN_BRANCH}}
        git push

问题是我作为所有者属于该组织,因此回购不在我的个人帐户中。我不断收到此错误:

Run git clone ***github.com/organization-username/repo.git -b development tmp
Cloning into 'tmp'...
fatal: could not read Username for 'https://github.com': No such device or address
Error: Process completed with exit code 1.

我的怀疑是问题可能不同用户名我正在执行此操作,并在组织和我的个人帐户之间切换,但没有成功。

关于我所缺少的任何指示。

【问题讨论】:

    标签: github automation github-actions


    【解决方案1】:

    你能弄清楚吗?

    【讨论】:

      猜你喜欢
      • 2017-03-09
      • 2023-02-07
      • 2013-09-24
      • 2019-06-24
      • 1970-01-01
      • 2015-05-06
      • 1970-01-01
      • 2020-08-02
      • 2019-03-14
      相关资源
      最近更新 更多