shayki5 / azure-devops-create-pr-task

Azure Pipelines task to create PR in Azure DevOps or GitHub during a build or release pipeline
https://marketplace.visualstudio.com/items?itemName=ShaykiAbramczyk.CreatePullRequest
MIT License
58 stars 35 forks source link

Source from specific commit on branch #142

Closed tcukanoot closed 2 years ago

tcukanoot commented 2 years ago

There may be a delay or multiple days between when our pipeline starts, and when it ultimately completes by by generating the pull request. In that time, there may have been additional commits to the source branch, so when the pull request task runs, it's actually pulling in newer code than what started the pipeline.

Is there a way to generate the pull request from the specific commit of the source branch? The one that was used to start the pipeline? sourceBranch: '$(Build.SourceBranch)'

Thanks,

shayki5 commented 2 years ago

Hi, It's impossible due git limitation, a PR merging a whole branch into another. You can create a new branch from the specific commit and create the PR from this branch.