concourse / git-resource

tracks commits in a branch of a Git repository
Apache License 2.0
192 stars 288 forks source link

Changes outside of the specified Paths are triggering pipelines #384

Open bajunkins opened 2 years ago

bajunkins commented 2 years ago

Hi, I have two different git resources pointing to the same repository; one of them has a paths option pointing to a specific subdirectory. I'm finding that even changes outside of this subdirectory are triggering the job to run.

Here are the resources:

- name: master-git
  type: git
  icon: git
  source:
    branch: ((default-branch))
    uri: ((gitlab-url))/((gitlab-project)).git
    username: ((gitlab-username))
    password: ((gitlab-token))

- name: subdirectory-git
  type: git
  icon: git
  source:
    uri: ((gitlab-url))/((gitlab-project)).git
    username: ((gitlab-username))
    password: ((gitlab-token))
    branch: ((default-branch))
    paths:
      - subdirectory/**

For the paths options, I've tried several different approaches: - subdirectory/*, - subdirectory/, - subdirectory

Here is the relevant part of the job:

- name: subdirectory-job
  serial: true
  plan:
    - get: master-git
    - get: subdirectory-git
      trigger: true 

This job is triggering from changes anywhere in the repo. I only want it to trigger for files under subdirectory/. Is this expected behavior? If so, how can I achieve what I'm looking for

suhlig commented 2 years ago

I see the same behaviour

Concourse 7.7.0

wapplermarc commented 1 year ago

The same here. Using Concourse 7.8.3.

alv-lop commented 8 months ago

Same on Concourse 7.10

marco-m-pix4d commented 1 month ago

I might be missing something here, but why does job subdirectory-job need to get both git resources? Getting only subdirectory-git would still make available the whole contents of the repo ...