这是indexloc提供的服务,不要输入任何密码
Skip to content

--filter=[origin/main] not working for headless branches #1079

@weyert

Description

@weyert

Describe the feature you'd like to request

If you try to use the --filter=[origin/main] command to detect the changes between current and the origin/main. Only on Gitlab the default behaviour is to use headless branches for their pull/merge requests and appears not to work.

Describe the solution you'd like

I think it would be great to improve the wait the git diff command is executed it appears that the following works for Gitlab CI but I have to confirm it again:

git diff --name-only origin/$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME

In the above $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME is the name of the pull request and the $CI_MERGE_REQUEST_TARGET_BRANCH_NAME would be the branch merging into typically main.

Describe alternatives you've considered

Stop using --filter=[origin/main] or similar filter arguments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions