gr2m / octokit-plugin-create-pull-request

Octokit plugin to create a pull request with multiple file changes
MIT License
104 stars 28 forks source link

Code not updating in newly created branch after a pull request #59

Closed shunjid closed 4 years ago

shunjid commented 4 years ago

Hi there,

You've created an awesome plugin :tada: . In one of my projects, I've been trying to use your plugin and successfully created a PR with some changes. But there is an issue.

Let's say, I haven't merged that newly created branch by your plugin and did some change again in my code. In that case, my desired change is not getting committed to the head branch. In this scenario, I'm getting some error like this below:

(node:2851) UnhandledPromiseRejectionWarning: HttpError: Reference already exists
    at /home/runner/work/{repo-name}/{repo-name}/node_modules/@octokit/request/dist-node/index.js:66:23
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async composeCreatePullRequest (/home/runner/work/{repo-name}/{repo-name}/node_modules/octokit-plugin-create-pull-request/dist-node/index.js:281:3)

My question:

Thanks :smile: , Have a good day !

gr2m commented 4 years ago

Hmm the Reference already exists is likely a result from trying to create a branch that already exists. I thought that we check for that, but seems we do not cover all cases.

Can you tell the steps to reproduce the problem?

shunjid commented 4 years ago

Hi @gr2m ,

To reproduce the problem we first need to

Afterwards, the plugin returns Reference already exists and throws an error.

gr2m commented 4 years ago

Why did you close the issue? Did you figure out the problem?

shunjid commented 4 years ago

@gr2m

Yeah. I was about to explain. There were some internet issues. Extremely sorry for late response.

In my code, I figured out that I wasn’t handling Promise in a correct way. Moreover there were some issues with caching in the environment I was running the program which were causing unexpected warning.

Once again, I wanna thank you for developing this awesome plugin. 😊