pull-request
pull-request copied to clipboard
source and destination branches are the same but not
I'm trying to use this action to auto create a PR triggered off a branch name into master
, basically the exact same example given in the docs. However, when the action runs, it says the Source and destination branches are the same.
and does not create the PR. I'm trying to trigger from source branch dm_update_tree
to destination branch master
. My workflow looks like the following:
name: Add New Paths
on:
push:
branches:
- dm_update_tree
jobs:
createpr:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create Pull Request
id: open-pr
uses: repo-sync/pull-request@v2
with:
source_branch: ""
destination_branch: "master"
pr_title: "New tree paths"
pr_body: ":crown: *An automated PR*"
pr_reviewer: "havok2063"
pr_label: "auto-pr,enhancement"
pr_draft: true
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Output PR URL
run: echo ${{steps.open-pr.outputs.pr_url}}
- name: Output PR Number
run: echo ${{steps.open-pr.outputs.pr_number}}
I have the same problem with this test config.
on:
push:
branches: [ "feature-1" ]
jobs:
pull-request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: pull-request
uses: repo-sync/pull-request@v2
with:
destination_branch: "dev"
github_token: ${{ secrets.GITHUB_TOKEN }}
I eventually figured it out. It works when there are committed differences between the source and destination branches. When there are no differences, you will get the message above and nothing will happen. In retrospect, I can see how Source and destination branches are the same
refers to that, but there could be additional clarification added to the message. Originally I thought it was an indication that the action was not checking out the correct source branch.
When there are no differences, you will get the message above and nothing will happen.
I can confirm that this was the issue 👍🏻
there is a parameter 'pr_allow_empty' that you can set to true, but it doesn't change anything... so I don't understand why this parameter exists, is this intended or a bug ?
@tassin-gauthier by default pull-request avoids PRs with just a merge commit and no content, pr_allow_empty
overrides this behavior and will create a PR with just a merge commit.
#62 has an idea to improve this behavior.