Skip to content
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

GitLab CI rules:changes always true on PR #16

Open
Potpourri opened this issue Feb 24, 2020 · 3 comments
Open

GitLab CI rules:changes always true on PR #16

Potpourri opened this issue Feb 24, 2020 · 3 comments

Comments

@Potpourri
Copy link
Owner

PR creates from branch, but rules:changes always true for new branch, see more here: https://docs.gitlab.com/ee/ci/yaml/#using-onlychanges-without-pipelines-for-merge-requests

@Potpourri
Copy link
Owner Author

When new branch created by mirror sync, rules:changes work as expected.

@Potpourri
Copy link
Owner Author

Potpourri commented Feb 25, 2020

rules:changes work only when:

  • $CI_PIPELINE_SOURCE == 'push'
  • $CI_PIPELINE_SOURCE == 'merge_request_event'

For $CI_PIPELINE_SOURCE == 'external_pull_request_event' it is always true. See issue: #37098

@Potpourri
Copy link
Owner Author

Potpourri commented Feb 25, 2020

If use GitHub Required statuses for PR with rules:changes, then PR should have only one commit.
Since $CI_PIPELINE_SOURCE == 'push' calculates changes from previous commit, and not from branch base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant