This tool is designed to synchronize issues between two GitHub repositories, including the ability to create new issues, update existing ones, and close issues based on their state in the upstream repository. Additionally, it logs all operations for debugging and auditing purposes using a standard logging mechanism that can be viewed with macOS's Console.app.
- Issue Synchronization: Automatically creates or updates issues in a target repository based on the upstream repository.
- State Handling: Checks if an issue is closed in the upstream repository and reflects this change in the target repository.
- Logging: Records all actions performed by the script into a log file and system logs for easy tracking and debugging.
- Environment Configuration: Uses
.env
files to manage sensitive information such as access tokens securely.
-
Install Dependencies
Ensure you have Node.js installed. Then, install the necessary packages:
pnpm i
-
Create .env File
In your project root directory, create a
.env
file with the following content:fork_owner = fork_repo = owner = repo = github_token = ghp_***
-
Run the Script
Execute script:
npm start
-
Terminal script
npx tsx src/tool.ts --help
The script will automatically handle synchronization of issues from the upstream repository to the target repository. It will also ensure that any issues marked as "closed" in the upstream repository are reflected as such in the target repository.
All operations performed by the script are logged into application.log
located in the same directory as the script. Additionally, logs are outputted to the system log, which can be viewed using macOS's Console.app.
- 🚀