create-pull-request
create-pull-request copied to clipboard
ambiguous argument unknown revision
Subject of the issue
I have a very simple workflow where I want to periodically checkout the repo, check for updated files, and then submit a PR from a new branch into main
, with any committed changes for the new files. I'd like it to create a new branch, dm_update_models
, to commit the changes into. Currently the action runs, finds changes that need to be committed, but fails to create a new PR. I get the following error: fatal: ambiguous argument 'origin/dm_update_models': unknown revision or path not in the working tree.
Does this action expect the branch to already exist or will it create it if needed? Originally, I did not have the base
option set to main
, but got the following error: The 'base' and 'branch' for a pull request must be different branches. Unable to continue.
Am I missing something here?
Steps to reproduce
The current github action workflow
name: Update access models
on:
schedule:
- cron: '0 9 * * 1'
jobs:
createpr:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
pip install -e ".[dev, all]"
- name: Update Models
run: datamodel tree update
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
title: Auto update datamodel access
body: |
Updating new datamodels with access information.
Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
base: main
branch: dm_update_models
delete-branch: true
draft: true
reviewers: havok2063
labels: |
auto-pr
enhancement
- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
and the full traceback
/usr/bin/git symbolic-ref HEAD --short
dm_update_models
Working base is branch 'dm_update_models'
/usr/bin/git checkout --progress -B 96f4a1f7-0ebc-4a12-8709-66b438a5cbbe HEAD --
Switched to a new branch '96f4a1f7-0ebc-4a12-8709-66b438a5cbbe'
M datamodel/products/access/spXCSAO.access
M datamodel/products/json/spXCSAO.json
M datamodel/products/yaml/spXCSAO.yaml
/usr/bin/git status --porcelain -unormal --
M datamodel/products/access/spXCSAO.access
M datamodel/products/json/spXCSAO.json
M datamodel/products/yaml/spXCSAO.yaml
Uncommitted changes found. Adding a commit.
/usr/bin/git add -A
/usr/bin/git -c author.name=havok2063 -c [email protected] -c committer.name=GitHub -c [email protected] commit -m [create-pull-request] automated change
[96f4a1f7-0ebc-4a12-8709-66b438a5cbbe 2a8818e] [create-pull-request] automated change
Author: havok2063 <[email protected]>
3 files changed, 45 insertions(+), 14 deletions(-)
/usr/bin/git reset --hard
HEAD is now at 2a8818e [create-pull-request] automated change
/usr/bin/git clean -f -d
Resetting working base branch 'dm_update_models'
/usr/bin/git checkout --progress dm_update_models --
Switched to branch 'dm_update_models'
/usr/bin/git reset --hard origin/dm_update_models
fatal: ambiguous argument 'origin/dm_update_models': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Error: The process '/usr/bin/git' failed with exit code 128