Closed
Description
I am trying to use this action to add new commits to a PR rather than having it replace the commits. I am running into issues with this action when it tries to reset the working base branch to its remote:
What I am trying:
- name: Checkout the testauthor/testrepo repo
uses: actions/checkout@v2
with:
path: testrepo
repository: testauthor/testrepo
- name: Track our fork
run: |
cd testrepo
git config user.email "${{ github.actor }}@users.noreply.github.com"
git config user.name "${{ github.actor }}"
git remote add bot-fork https://github.com/myuser/testrepo
git fetch bot-fork
git checkout -b mybranch --track bot-fork/mybranch
# Step here that makes changes in testrepo dir
- name: Commit changes
run: |
cd testrepo
git add -A
git diff-index --quiet HEAD || git commit -m "MyChange: ${{ github.event.pull_request.title }}"
- name: Create PR in testauthor/testrepo
id: create-pr
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.PAT }}
push-to-fork: myuser/testrepo
path: testrepo
base: master
branch: mybranch
title: "MyChange: ${{ github.event.pull_request.title }}"
body: |
Pull Request: ${{ github.event.pull_request.html_url }}
@myuser
What happens:
The action ends up failing at
because it tries to:
/usr/bin/git -c protocol.version=2 fetch --no-tags --progress --no-recurse-submodules --unshallow --force origin mybranch:mybranch
fatal: couldn't find remote ref node
Error: The process '/usr/bin/git' failed with exit code 128
This fails because there is no mybranch
branch on the origin. It only exists on my fork. And even then, it's certainly possible to have the working branch not track any remote, and I would like this action to work in that case. It would be nice to be able to stop this action from trying to reset the working base branch to its remote in cases like these.
Metadata
Metadata
Assignees
Labels
No labels