Skip to content

Conversation

@pyrocat101
Copy link
Contributor

Summary

  • Add --changed-files-path CLI flag and BUILDKITE_CHANGED_FILES_PATH environment variable
  • When provided, the agent reads changed files from the specified file instead of running git commands
  • File format is newline-separated list of file paths

Motivation

This is useful when:

  • Working with shallow clones where git history is limited
  • Using external monorepo tools (Bazel, Nx, Turborepo) that have their own change detection
  • CI systems that already compute changed files upstream
  • Non-git repositories

Usage

# Via CLI flag
buildkite-agent pipeline upload --changed-files-path /path/to/changed-files.txt

# Via environment variable
BUILDKITE_CHANGED_FILES_PATH=/path/to/changed-files.txt buildkite-agent pipeline upload

File format:

src/main.go
pkg/feature/handler.go
README.md

Test plan

  • Added unit tests for readChangedFilesFromPath function
  • Added integration test for ifChangedApplicator with changedFilesPath
  • Verified existing if_changed tests still pass

🤖 Generated with Claude Code

Add support for providing a pre-computed list of changed files via a
newline-separated file, instead of having the agent run git commands
to determine the diff.

This is useful when:
- Working with shallow clones where git history is limited
- Using external monorepo tools (Bazel, Nx, Turborepo) that have their
  own change detection
- CI systems that already compute changed files upstream
- Non-git repositories

Usage:
  buildkite-agent pipeline upload --changed-files-path /path/to/files.txt

Or via environment variable:
  BUILDKITE_CHANGED_FILES_PATH=/path/to/files.txt

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Copy link
Contributor

@DrJosh9000 DrJosh9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pyrocat101 ! LGTM

@DrJosh9000 DrJosh9000 merged commit 8172c2b into buildkite:main Dec 11, 2025
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants