Skip to content

Ensure pull request branch name does not cause collisions #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

weierophinney
Copy link
Member

When a pull request is made by a user and they name their branch the same name as the target branch against which the pull request is being made, we run into a conflict, which causes the checkout to fail (see https://github.com/mezzio/mezzio-helpers/pull/7/checks?check_run_id=2393994090#step:3:9).

To resolve this scenario, if we detect a pull_request, we can give the local branch name a prefix, pull/.

@weierophinney weierophinney added this to the 1.7.1 milestone Apr 20, 2021
@weierophinney weierophinney added the Bug Something isn't working label Apr 20, 2021
When a pull request is made by a user and they name their branch the same name as the target branch against which the pull request is being made, we run into a conflict, which causes the checkout to fail (see https://github.com/mezzio/mezzio-helpers/pull/7/checks?check_run_id=2393994090#step:3:9).

To resolve this scenario, if we detect a pull_request, we can give the local branch name a prefix, `pull/`.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
@weierophinney weierophinney force-pushed the hotfix/pull_request_branch branch from 54835e9 to ac9c9d4 Compare April 20, 2021 19:59
@weierophinney weierophinney merged commit 5f70dd5 into laminas:1.7.x Apr 20, 2021
weierophinney added a commit to weierophinney/laminas-continuous-integration-action that referenced this pull request Apr 20, 2021
… branch

Similar to the issue reported in laminas/laminas-ci-matrix-action#29, we need to ensure that when we fetch the `$GITHUB_REF`, we fetch it into a branch that is named differently than the base branch to avoid collisions and errors.

This patch accomplishes it by adding a `pull/` prefix to the pull request branch name.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
weierophinney added a commit to weierophinney/laminas-continuous-integration-action that referenced this pull request Apr 20, 2021
… branch

Similar to the issue reported in laminas/laminas-ci-matrix-action#29, we need to ensure that when we fetch the `$GITHUB_REF`, we fetch it into a branch that is named differently than the base branch to avoid collisions and errors.

This patch accomplishes it by adding a `pull/` prefix to the pull request branch name.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
@boesing
Copy link
Member

boesing commented Apr 21, 2021

Fixes #24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants