A Rust application that monitors changes in specified files across GitHub repositories and provides notifications when changes are detected.
- Monitor multiple GitHub repositories simultaneously
- Track specific files within each repository
- Detect file changes using SHA-256 hashing
- Maintain state between runs
- Configurable notification system
- Clone the repository
- Ensure you have Rust installed
- Build the project:
make build
Create a config.yaml
file in the project root with the following structure:
repositories:
- owner: repository-owner
repo: repository-name
token: github-access-token
branch: main
files:
- path/to/file1
- path/to/file2
state_file: state.yaml
notification_command: "your-notification-command"
repositories
: List of GitHub repositories to monitorowner
: Repository owner/organizationrepo
: Repository nametoken
: GitHub access tokenbranch
: Branch to monitorfiles
: List of files to trackstate_file
: Location to store the statenotification_command
: Command to execute when changes are detected
Run the application:
cargo run
The application will:
- Read the configuration from
config.yaml
- Check specified files for changes
- Update the state file when changes are detected
- Execute the notification command when changes occur
reqwest
: HTTP client for GitHub API requestsserde
: Serialization/deserialization of YAMLsha2
: SHA-256 hashing functionalitytempfile
: Temporary file handling for tests
Run the test suite:
make test
The test suite includes:
- Configuration deserialization tests
- State serialization tests
- File hash retrieval tests
- Change detection tests