repo-sync / pull-request Goto Github PK
View Code? Open in Web Editor NEW⤵️ A GitHub Action for creating pull requests
Home Page: https://github.com/marketplace/actions/github-pull-request-action
License: MIT License
⤵️ A GitHub Action for creating pull requests
Home Page: https://github.com/marketplace/actions/github-pull-request-action
License: MIT License
Hi @repo-sync!
Thanks for the action, we are using it and it is helping us a lot.
I found an issue, probably on our end, but I would like to share it anyway.
We have a folder named prod and a branch also named prod. When we tried to trigger the action we saw that we are getting this error:
fatal: ambiguous argument 'prod': both revision and filename
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
We noticed that adding --
in the following line https://github.com/repo-sync/pull-request/blob/master/entrypoint.sh#L37 works.
If you feel like is an issue, i can submit a PR.
Best regards,
Pablo
I've got an interesting problem: I would like an automated process that creates PRs from one long-lived branch to another, where one PR might on occasion contain multiple changes. To help reference the changes rolled up in these PRs, I'd like to leave a comment on the existing PR.
To that end, it would be really cool if repo-sync/pull-request
could find & set the existing pull request's ID/URL in output in the "fails silently if the PR already exists" case.
Currently, I have this change: antifuchs/test_repo_for_production_branch@d5e0535, which results in this output. I would love to have to not have to replicate a large part of this action's logic in order to get at that information!
There are two problems with self-hosted runners:
The first problem is solved by building a docker image and referencing it in a workflow:
- name: 'Create pull request'
uses: docker://ghcr.io/tegorov/pull-request:v2.6.2
with:
source_branch: develop
...
The second problem is solved by passing USER_ID parameter in a container:
- name: 'Create pull request'
uses: docker://ghcr.io/tegorov/pull-request:v2.6.2
with:
source_branch: develop
...
env:
USER_ID: 1000
Here is my pull request as an example #90
Hello, our team is using this GH action and we were wondering if it works when using a GH team name in the pr_reviewer field. We have tried but it doesn't appear to be working. Do we need to include anything special to do this?
our org name is something like "abcinc"
our team name is something like "cool-team"
we tried:
pr_reviewer: "some-person-account,cool-team"
as well as:
pr_reviewer: "some-person-account,abcinc/cool-team"
But they don't seem to be working. Any suggestions or is this a feature request?
Software in virtual environments for GitHub Actions page lists a hand full of useful pre-installed software but it's missing the hub
CLI which would be really helpful to a lot of use cases in Github Actions.
At this time, the workaround is to install it manually.
Lines 9 to 10 in f78e9cd
I tried like this destination_branch: '${{env.GIT_BRANCH_NAME}}*'
but got this error: fatal: bad revision 'release-v1*'
${{env.GIT_BRANCH_NAME}} = release-v1
I'm looking to get destination branch that name is 'release-v1.1'
Is it possible to create a PR with auto-merge option enabled? it's in beta now, docs are here
Currently when CI runs it fails with a fatal: bad revision 'refs/pull/351/merge'
error. This seems strange because every other workflow that is ran such as our build workflow doesn't have any issues, only this workflow and specifically only the repo-sync/pull-request
step of this wokflow fail.
Here is an outline of the failing workflow:
name: Pull Request
on:
pull_request:
branches: [master]
jobs:
pull-request:
runs-on: ubuntu-latest
steps:
- uses: toshimaru/[email protected]
with:
repo-token: ${{ secrets.GH_TOKEN }}
- uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
- uses: atlassian/gajira-find-issue-key@master
id: jira-issue-number
with:
from: branch
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: repo-sync/pull-request@v2
with:
pr_title: "Omitted"
pr_body: "Omitted"
pr_reviewer: "Omitted"
pr_label: "Omitted"
github_token: ${{ secrets.GH_TOKEN }}
All the other steps pass fine as you can see here:
Any help would be much appreciated!
Thanks a lot for sharing this action!
I am trying to use it in a workflow to make a PR to a different repo. Specifically, I am trying to set up a workflow to make a PR to update a submodule in a different repo whenever the submodule target repo is changed.
The repo where the action is running is pangeo-gallery/example-gallery
(the target of the submodule), while the repo where the submodule lives is pangeo-gallery/pangeo-gallery
I am getting this error:
warning: no common commits
From https://github.com/pangeo-gallery/example-gallery
* [new branch] binderbot-built -> binderbot-built
* [new branch] github-actions -> github-actions
+ 84b9a01...bfc1e8d master -> master (forced update)
* [new branch] binderbot-built -> origin/binderbot-built
* [new branch] github-actions -> origin/github-actions
+ 84b9a01...bfc1e8d master -> origin/master (forced update)
hub pull-request -b master -h binderbot-update --no-edit -m "Update pangeo-gallery/example-gallery submodule" -m ":crown: *An automated PR*" || true
Error creating pull request: Unprocessable Entity (HTTP 422)
Invalid value for "head"
It looks like the action is trying to make the PR from pangeo-gallery/example-gallery
, rather than pangeo-gallery/pangeo-gallery
. I would like it to come from pangeo-gallery/pangeo-gallery
, which I have already checked out earlier in my workflow.
Is this possible?
My workflow is here:
https://github.com/pangeo-gallery/example-gallery/blob/master/.github/workflows/pangeo-gallery.yaml
You can see the log here:
https://github.com/pangeo-gallery/example-gallery/runs/515467109?check_suite_focus=true#step:6:11
For environments where approvers are required; and that approver can't be self having the bot being the owner means that the person who pushed the branch can approve their own PRs
- uses: actions/checkout@v1
with:
ref: develop
- name: pull-request
uses: repo-sync/pull-request@v2
with:
source_branch: develop
destination_branch: master
pr_label: automerge
github_token: ${{ secrets.GITHUB_TOKEN }}
fails with:
##[error]Docker run failed with exit code 128
Run repo-sync/pull-request@v2
/usr/bin/docker run --name e4e3a6913e7162e7d458b897f452bfbccfa89_b5ac7c --label 2e4e3a --workdir /github/workspace --rm -e INPUT_SOURCE_BRANCH -e INPUT_DESTINATION_BRANCH -e INPUT_PR_LABEL -e INPUT_GITHUB_TOKEN -e INPUT_PR_TITLE -e INPUT_PR_BODY -e INPUT_PR_REVIEWER -e INPUT_PR_ASSIGNEE -e INPUT_PR_MILESTONE -e GITHUB_TOKEN -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/nasawds-2.0/nasawds-2.0":"/github/workspace" 2e4e3a:6913e7162e7d458b897f452bfbccfa89
fatal: Refusing to fetch into current branch refs/heads/develop of non-bare repository
##[error]Docker run failed with exit code 128
Any ideas?
Hello i have an error when the action is trigger :
step :
touch delete.me
git push origin test-auto-pr
My .yml :
name: Create Pull Request
on:
push:
branches:
- "*"
- "!develop"
- "!master"
jobs:
pull-request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: pull-request
uses: repo-sync/pull-request@v2
with:
destination_branch: "develop" # If blank, default: master
pr_title: "${{github.actor}} triger auto pr : ${{ github.ref }} into develop"
pr_body: "📡 *An automated PR*" # Full markdown support, requires pr_title to be set
pr_reviewer: "bouteillerAlan" # Comma-separated list (no spaces)
pr_assignee: "bouteillerAlan" # Comma-separated list (no spaces)
pr_label: "auto-pr" # Comma-separated list (no spaces)
github_token: ${{ secrets.GITHUB_TOKEN }}
Firstly, thanks guys and girls for this action. Been really enjoying using it! Just a small request: when trying to work out what went wrong during implementation the verbosity from the following line, made it very difficult to find out what was going on.
Line 29 in 65194d8
Can I suggest an optional flag here?
Can I also suggest an echo within the following if clause: It just makes debugging a great deal easier!
Lines 89 to 91 in 65194d8
Hi,
I am getting fatal: bad revision 'master' even I have distribution branch set to 'develop', I am using v2.6.1.
Where is this coming from?
From https://github.com/netSkope/ep-versioner
Is it possible to reference the title of the original pr?
I wanted to do something like pr_title: "Pulling ${{ pr_title }} into master"
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: repo-sync/pull-request@v2
with:
github_token: ${{ secrets.PAT }}
pr_title: "⤴️ ${{ github.actor }} Draft Merge Request"
pr_body: |
:arrow_heading_up: Closes: #issueid <!-- your issue -->
**Describe the Change** <!-- A longer description -->
"Put a description here"
pr_draft: true
Expected: PR body is complete
Actual: PR body cuts off at Put
, without the quotation marks
I think the cause for this is the arg building for hub which doesn't have any double quote protection. Unfortunately, there's not much that can be done. Either the pr_body allows ${{ expressions }}
, or it has to require "
to be escaped. The current behavior requires "
to be escaped, at which point we may just want to update the readme.
Thanks for your inputs 😃
PR welcome if any of you have time. Potential solution is in my last comment~
Originally posted by @wei in #27 (comment)
hi there.
I created a workflow using this actions, but the workflow I already created is no longer executed.
Workflow that is executed when pull_request is created in develop and main. An example is shown below.
name: example
on:
workflow_run:
workflows: ["Create Pull Request"]
types:
- completed
pull_request:
branches:
- main
- develop
jobs:
...
The workflow using repo-sync/pull-request
looks like this.
name: Create Pull Request
on:
push:
branches:
- feature/*
jobs:
create-pull-request:
name: create-pull-request
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Create Pull Request
id: open-pr
uses: repo-sync/pull-request@v2
with:
destination_branch: "develop"
pr_title: "[example] test_summary"
pr_body: "test body."
github_token: ${{ secrets.GITHUB_TOKEN }}
If you know any solution, please let me know.
I look forward to working with you : )
We are using self-hosted runners, and repo-sync/pull-request@v2
uses Docker image to create a intermediate docker image to run it. After a some period of time we are experiencing storage issues because of intermediate images.
Is it possible to provide a JS implementation, in order to avoid image creation?
I haven't found a way how to link the newly created issue with an Issue.
Use the checked out remote instead of fetching from GITHUB_REPOSITORY
when appending tokens
Line 23 in d80b305
I discovered that when e.g. GitHub API is not available this action still succeeds, should it?
Related line is prob:
Line 87 in ff8726a
Right now we use this action internally on a repo to test how it works but we noticed that the person who pushes the code is not the PR author once it is generated, instead that will be the person who the GITHUB_TOKEN belongs to. How can we make the person who pushed the code the author of the PR also?
👋 Hey! Small feature request, it'd be great to be able to get just the created PR number in subsequent steps, instead of just the url.
I was testing this plugin on a self hosted system and I get this error(I replaced the hostname):
fatal: unable to access 'https://HOSTNAME/RSSIT-Test/test_one/': SSL certificate problem: self signed certificate in certificate chain
Is it possible to resolve this?
On v2, I've set the pr_reviewer but it doesn't seem to be working.
Interestingly, running the echoed command locally on my machine works.
Is it possible to automatically trigger "Re-request review" in case that PR was approved by reviewer but new code was committed after approval and before merging?
For example, my .yml
file has following configuration:
on:
push
jobs:
pull-request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: pull-request
uses: repo-sync/pull-request@v2
with:
destination_branch: "develop"
pr_title: "${{github.actor}} - Pulling ${{ github.ref }} into develop"
pr_reviewer: "bomb-on"
pr_assignee: "bomb-on"
pr_label: "auto-pr"
github_token: ${{ secrets.GITHUB_TOKEN }}
Let's say that one of the repository contributors creates a new feature branch and pushes it:
git flow feature start 'test-feature-1'
echo "feature1" > feature1
git add .
git commit -m "First Feature"
git push --set-upstream origin feature/test-feature-1
The PR will be created and assigned for review. I do review and approve it but I don't merge it immediately. At this point, same user updates the same branch, e.g.:
echo "update" >> feature1
git add .
git commit -m "First Feature Update"
git push
This commit will end up in the same PR and I can see that there has been changes in GitHub's PR page:
but it won't trigger "Re-request review" and it will look like updated code has been reviewed and whole PR approved.
So, is it possible to somehow automatically trigger this "Re-request review" in such case?
Hello and thank you for this action. Although I am using the same workflow in a different repository in the same organization, I am having an interesting error in a single repository. Here is my workflow and the error that I am having. Any idea what might be going on?
fatal: unsafe repository ('/github/workspace' is owned by someone else)
To add an exception for this directory, call:
git config --global --add safe.directory /github/workspace
name: auto create PR to develop
on:
pull_request:
branches:
- main
types:
- closed
jobs:
pull-request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: pull-request
if: github.event.pull_request.merged == true
uses: repo-sync/pull-request@v2
with:
source_branch: ${{ github.head_ref }}
destination_branch: "develop"
pr_title: ${{ format('Auto PR from {0}', github.head_ref) }}
pr_allow_empty: false
github_token: ${{ secrets.GITHUB_TOKEN }}
I have a use case where I need the PR URL for a subsequent steps in the workflow, but I cannot find any actions that provide that as an output. Would it be possible to provide the URL of the PR as an output from the action?
I am using this to open PR again production branch which has the short sha of the latest commit.
Most fo the time the PR is already open and the title has old hash value, how can I close old PR and create a new or change only the title of the opened PR?
At https://github.com/step-security/secure-workflows we are building a knowledge-base (KB) of GITHUB_TOKEN permissions needed by different GitHub Actions. When developers try to set minimum token permissions for their workflows, they can use this knowledge-base instead of trying to research permissions needed by each GitHub Action they use.
Below you can see the KB of your GITHUB Action.
name: GitHub Pull Request Action
github-token:
action-input:
input: github_token
is-default: false
permissions:
pull-requests: write
pull-requests-reason: to create pull requests #Checkout: https://github.com/repo-sync/pull-request#features
#Fixes #497
If you think this information is not accurate, or if in the future your GitHub Action starts using a different set of permissions, please create an issue at https://github.com/step-security/secure-workflows/issues to let us know.
This issue is automatically created by our analysis bot, feel free to close after reading :)
GitHub asks users to define workflow permissions, see https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/ and https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token for securing GitHub workflows against supply-chain attacks.
Setting minimum token permissions is also checked for by Open Source Security Foundation (OpenSSF) Scorecards. Scorecards recommend using https://github.com/step-security/secure-workflows so developers can fix this issue in an easier manner.
Hey Guys,
I am using this action on my private repository but it seems there are some errors in the processing like below:
Error creating pull request: Not Found (HTTP 404)
Not Found
Are you sure that github.com/SharryXu/blog exists?
Do you guys have any ideas? Maybe I need to add more options when creating the PAT?
Is it possible to add an option to specify an organization team to the pr_reviewer option?
Hi! 👋 Great action, thank you for making it.
We have a situation where our development branch only allows squash merges, and our main branch cannot be committed to directly. When we create a pull request from main
-> development
and there's any conflict, we cannot fix the conflict and have to manually create another pull request.
Would you accept a PR to add a feature to create an intermediary branch? Something like:
- name: pull-request
uses: repo-sync/pull-request@v2
with:
destination_branch: ${{ env.TARGET }}
branch_name: ${{ env.BRANCH_NAME }} # 🆕 Add input for branch name
This would create a branch from source_branch
named branch_name
that targets destination_branch
.
The script would simply create the branch name from the source branch and push it before running the hub
command.
Hi, i'm trying to add the team as a reviewer but is not picking it up
I've tried pr_reviewer: "team-prs"
pr_reviewer: "/team-prs"
pr_reviewer: "@org/team-prs"
pr_reviewer: "org/team-prs"
and it shows an error Error requesting reviewer: Unprocessable Entity (HTTP 422)
any ideas?
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}}
As then this would automatically contain everything ready for filling out as part of the review.
fatal: Refusing to fetch into current branch refs/heads/release/1.0 of non-bare repository
15
##[error]Docker run failed with exit code 128
(git is no longer in detached state, see https://github.com/actions/checkout/releases/tag/v2.0.0)
Line 83 in f4c9191
The problem with silent failure is I don't know when it ... fails!
please add
allow_failure: true
to the configuration, so I can set it to false
Hi. I'm getting: fatal: Refusing to fetch into current branch [...] of non-bare repository
For clean repository it happens for example when I run actions/checkout@v2
. Works only for actions/checkout@v1
.
But when I make some changes to files, want to push it to a new branch and then create pull request from it it's happening again. So basically when current local branch is not equal to GIT_REF
.
How can this be solved? Any ideas?
We use the https://github.com/tibdex/github-app-token to generate a token so we can have a workflow trigger another workflow etc etc.
However when we use that generated token with this PR Action it creates the PR but none of the workflows are triggered for that PR, it's as if it used the secrets.GITHUB_TOKEN
somehow and not the one generated in the generate-token step. We use that generate token process in other workflows without issues, this is the first time we are using it in a workflow that was already using this PR action.
We even created a personal access token, just to test this, and the same thing happens with this action it creates the PR but non of the workflows for the PR run.
We have a step like this:
- name: Generate Token
uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.GENERATED_TOKEN_APP_ID }}
private_key: ${{ secrets.GENERATED_TOKEN_APP_PRIVATE_KEY }}
Then we run the PR action like this:
- name: Create Pull Request
id: open-pr
uses: repo-sync/pull-request@v2
with:
source_branch: ${{ steps.release_name.outputs.branch }}
destination_branch: master
pr_title: Release ${{ steps.release_name.outputs.name }}
pr_body: ${{ steps.read_file.outputs.contents}}
pr_label: release
github_token: ${{ steps.generate-token.outputs.token }}
When I run this action on self-hosted runner, I get the following error:
Run repo-sync/pull-request@v2
/usr/bin/docker run --name cd3395d146bea0da2d51c305be69_a232a7 --label 765292 --workdir /github/workspace --rm -e INPUT_SOURCE_BRANCH -e INPUT_DESTINATION_BRANCH -e INPUT_PR_TITLE -e INPUT_PR_BODY -e INPUT_PR_LABEL -e INPUT_GITHUB_TOKEN -e INPUT_PR_TEMPLATE -e INPUT_PR_REVIEWER -e INPUT_PR_ASSIGNEE -e INPUT_PR_MILESTONE -e INPUT_PR_DRAFT -e INPUT_PR_ALLOW_EMPTY -e GITHUB_TOKEN -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/opt/actions-runner/_work/_temp/_github_home":"/github/home" -v "/opt/actions-runner/_work/_temp/_github_workflow":"/github/workflow" -v "/opt/actions-runner/_work/test-github-actions/test-github-actions":"/github/workspace" 765292:2070cd3395d146bea0da2d51c305be69
fatal: not a git repository (or any parent up to mount point /github)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Could you, please, tell, what the problem may it be with?
Hi!
I'm experiencing this error when running the action:
could not find any git remote pointing to a GitHub repository
The action reports success but a PR is not created - I have noticed that if I re-run the job from the UI it is successful and creates the PR.
Below is a snippet of my configuration and logs
jobs:
pull-request:
name: Open PR to main
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
name: checkout
- uses: repo-sync/pull-request@v2
name: pull-request
with:
destination_branch: "main"
pr_title: "Pulling ${{ github.ref }} into main"
pr_body: "👑 *An automated PR*"
pr_reviewer: "craigbryson"
pr_draft: true
github_token: ${{ secrets.GITHUB_TOKEN }}
From https://github.com/myOrg/myRepo
11
* [new branch] main -> main
12
* [new branch] main -> origin/main
13
* core-image-updates 3cf280d [origin/core-image-updates] **Automated image update**
14
main 26fbf22 Update nginx-ingress.yaml
15
remotes/origin/core-image-updates 3cf280d **Automated image update**
16
remotes/origin/main 26fbf22 Update nginx-ingress.yaml
17
hub pull-request -b main -h core-image-updates --no-edit -m "Pulling refs/heads/core-image-updates into main" -m "👑 *An automated PR*" -r "craigbryson" -d || true
18
Aborted: could not find any git remote pointing to a GitHub repository
Am I going wrong somewhere?
When using github job specific permissions and not allowing pr writes, this action should error.
I believe the issue is here:
https://github.com/repo-sync/pull-request/blob/master/entrypoint.sh#L84
Using || true
will allow this command to succeed even during failure?
To recreate:
Make default action permission in repo = read-only
Settings -> Actions -> Workflow permissions -> Read repository contents permission
Run action with repo-sync/pull-request
No PR created, but action succeeds with message like
hub pull-request -b master -h branchybranchy --no-edit -m "some message" || true
Error creating pull request: Forbidden (HTTP 403)
Resource not accessible by integration
jobs:
create-pr:
name: "create some PR"
permissions:
pull-requests: write
...
hub pull-request -b master -h branchybranchy --no-edit -m "some message" || true
https://github.com/loosebazooka/testtest/pull/16
I have a few white-label branches and I want to create a PR to these branches whenever my master branch is updated. Is it possible to use a wildcard to achieve this?
The action doesn't create PR even if there are commits between destination and source branch.
No file changes detected between source and destination branches.
It looks be caused by #43 which changed diff command to
git diff --name-only -- "$DESTINATION_BRANCH" "$SOURCE_BRANCH"
Below shows the change of the behavior by #43:
$ git init
Initialized empty Git repository in /tmp/pull-request/.git/
# Add a.txt to master branch
$ touch a.txt; git add a.txt; git commit -m "Add a.txt"
[master (root-commit) 5bd1d04] Add a.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 a.txt
# Create the-branch and add b.txt, then master and the-branch should have diff
$ git checkout -b the-branch
Switched to a new branch 'the-branch'
$ touch b.txt; git add b.txt; git commit -m "Add b.txt"
[the-branch 27ce7e0] Add b.txt
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 b.txt
$ DESTINATION_BRANCH=master
$ SOURCE_BRANCH=the-branch
# This is the script after #43 and LINES_CHANGED is 0 (**incorrect**)
$ LINES_CHANGED=$(git diff --name-only -- "$DESTINATION_BRANCH" "$SOURCE_BRANCH" | wc -l | awk '{print $1}')
$ echo $LINES_CHANGED
0
# This is the script before #43 and LINES_CHANGED is 1 (**correct**)
$ LINES_CHANGED=$(git diff --name-only "$DESTINATION_BRANCH" "$SOURCE_BRANCH" | wc -l | awk '{print $1}')
$ echo $LINES_CHANGED
1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.