Intermitent failures buildkite monorepo plugin

  - label : "STEP 0: Triggering test pipeline  if required"
    key: "trigger-test-non-master"
if: build.pull_request.base_branch != null && build.branch !="master" 
    plugins:
      - buildkite-plugins/monorepo-diff#v1.0.1:
          diff: "git diff --name-only refs/remotes/origin/${BUILDKITE_PULL_REQUEST_BASE_BRANCH}..refs/remotes/origin/${BUILDKITE_BRANCH}"
          watch:
            - path:
                - "lib"
              config:
                trigger: "test-pipeline"
    agents :
      os : linux
      service : "agent"

It fails randomly, and when it fails , it fails with the below error msg

$ /etc/buildkite-agent/plugins/github-com-buildkite-plugins-monorepo-diff-buildkite-plugin-v1-0-1/hooks/command
INFO[0000] --- running monorepo-diff-buildkite-plugin 2.0.0
INFO[2025-06-12T10:37:59Z] Running diff command: git diff --name-only refs/remotes/origin/test..refs/remotes/origin/fix_error_logs
FATA[2025-06-12T10:37:59Z] diff command failed: command `/bin/sh` failed: exit status 128
🚨 Error: The command exited with status 1
user command error: The plugin monorepo-diff command hook exited with status 1

Unable to understand what is causing this issue ?

Hey @Pavan :waving_hand:

Thanks for reaching out! Curious, have you tried newest version of the plugin v1.4.0?
Feel free to swap out the current plugin reference to monorepo-diff#v1.4.0 and let us know if that helped!
If the issue persists with newest version, I think it’d be best to reach out to us at support@buildkite.com and provide link to the pipeline (or pipelines) where you observe the issue.

Thanks!

Sure, thanks
will tryout the new version but since the issue is intermittent might need few days to see if this is not happening again

@Pavan makes sense!
One thing that came to me know would be running the git diff command in isolation, e.g. taking all the parameters from failed job to rule out that git itself is not a contributing factor.