【发布时间】: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