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 buildCreate 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 runThe 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 testThe test suite includes:
- Configuration deserialization tests
- State serialization tests
- File hash retrieval tests
- Change detection tests