Comments (5)
Hi @antoineqian,
You are trying to create a PR where the changes already exist in a branch. There's a section in the docs about this, with possible solutions: https://github.com/peter-evans/create-pull-request/blob/main/docs/common-issues.md#create-using-an-existing-branch-as-the-pr-branch
from create-pull-request.
Hi @grndvl1
Previous steps I created a new branch
I think this is a misunderstanding about how this action works. This action expects to be creating and managing the PR branch itself. The branch
input should not be an existing branch that already contains your changes.
I can't see your linked workflow, probably because the repository is private. If you show me your workflow I'll try to help you further.
from create-pull-request.
This action does not just create a pr but first commits and pushes current working changes.
from create-pull-request.
Hi @peter-evans
First I don't know if I should create a new question. Let me know and I will. But my issue is basically the same.
My workflow looks like this
on:
workflow_call:
push:
branches:
- dev
jobs:
open-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Open PR from dev to main
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.generate-token.outputs.token }}
base: main
branch: "upgrade-from-dev-${{ github.run_id }}"
title: "Update main from dev"
body: "Automatically opened PR to merge dev into main."
My goal is that whenever a new commit is pushed to dev (ie., when a PR targeting dev is closed and merged), this workflow should create a PR to merge those new changes into the main branch, if such PR does not already exists.
In the logs of the action I see (removed some useless lines)
/usr/bin/git symbolic-ref HEAD --short
dev
Working base is branch 'dev'
/usr/bin/git checkout --progress -B 9d1f8d9f-345b-4852-8b[43](https://github.com/XXXX/actions/runs/9192830460/job/25282452556#step:4:49)-16201aa49f1d HEAD --
Switched to a new branch '9d1f8d9f-345b-4852-8b43-16201aa49f1d'
/usr/bin/git status --porcelain -unormal --
/usr/bin/git diff --quiet --
/usr/bin/git diff --quiet --staged --
/usr/bin/git stash push --include-untracked
No local changes to save
Resetting working base branch 'dev'
/usr/bin/git checkout --progress dev --
Switched to branch 'dev'
Your branch is up to date with 'origin/dev'.
/usr/bin/git reset --hard origin/dev
HEAD is now at d6ca65f Merge pull request #69 from XXX/some-change
Rebasing commits made to branch 'dev' on to base branch 'main'
/usr/bin/git -c protocol.version=2 fetch --no-tags --progress --no-recurse-submodules --force --depth=1 origin main:main
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 6 (delta 5), reused 0 (delta 0), pack-reused 0
From https://github.com/Ynstant/brevo
* [new branch] main -> main
* [new branch] main -> origin/main
/usr/bin/git checkout --progress main --
Switched to branch 'main'
/usr/bin/git rev-list --reverse dev..9d1f8d9f-345b-4852-8b43-16201aa49f1d .
/usr/bin/git checkout --progress -B 9d1f8d9f-345b-4852-8b43-16201aa49f1d HEAD --
Switched to and reset branch '9d1f8d9f-345b-4852-8b43-16201aa49f1d'
/usr/bin/git -c protocol.version=2 fetch --no-tags --progress --no-recurse-submodules --force --depth=1 origin main:main
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
/usr/bin/git rev-list --right-only --count main...9d1f8d9f-345b-4852-8b43-16201aa49f1d
0
/usr/bin/git -c protocol.version=2 fetch --no-tags --progress --no-recurse-submodules --force --depth=10 origin upgrade-from-dev-9192830[46](https://github.com/XXX/actions/runs/9192830460/job/25282452556#step:4:52)0:refs/remotes/origin/upgrade-from-dev-9192830460
fatal: couldn't find remote ref upgrade-from-dev-9192830460
Pull request branch 'upgrade-from-dev-9192830460' does not exist yet.
/usr/bin/git checkout --progress -B upgrade-from-dev-9192830460 9d1f8d9f-345b-[48](https://github.com/XXX/actions/runs/9192830460/job/25282452556#step:4:54)52-8b43-16201aa49f1d --
Switched to a new branch 'upgrade-from-dev-9192830460'
/usr/bin/git rev-list --right-only --count main...upgrade-from-dev-9192830460
0
So it seems that the branch specified in the branch
parameter is, after some rebasing that I don't understand, at the same place as the main
branch which is not what I expected.
It's not clear to me from the doc how the action works, and it seems i'm not using it properly. Can you understand and fix my workflow ?
from create-pull-request.
I'm closing this now because this isn't really an issue with the action, it's just a bit of misunderstanding about how the action works.
from create-pull-request.
Related Issues (20)
- Default to "Squash and Merge" HOT 1
- I get error "protected branch hook declined" when I try to create a draft pull request into protected branch HOT 1
- Force update the branch of existing pull request HOT 1
- Empty PRs being created, is this expected? HOT 4
- Error creating new PR HOT 2
- `title-path` and `commit-message-path` inputs HOT 1
- `base` also does a checkout to that branch HOT 1
- Update multiple repositories HOT 2
- ignore untracked HOT 2
- Required checks are not being triggered after the PR creation HOT 1
- Error: Input 'token' not supplied. Unable to continue. HOT 1
- Changes from test folder doesn't added to the PR HOT 10
- Node version - Warning HOT 1
- Permission denied (publickey) HOT 1
- Merge conflict error for different files with different names
- Add branch-label as an output so it can be passed to other actions and easily commited to HOT 2
- PR still created with 0 files (no diffs)
- [FEATURE] Add ability to enable auto-merge
- Can't figure out how to include commits made during workflow
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from create-pull-request.