A GitHub automation tool for updating package dependencies via pull requests.
- Automatically update package dependencies in GitHub repositories
- Create pull requests with the changes
- Support for all dependency types (dependencies, devDependencies, peerDependencies, optionalDependencies)
- Type-safe TypeScript implementation
- Comprehensive test coverage
- Code formatting with Prettier and ESLint
- Optimized for pnpm package manager
- Node.js >= 22.0.0
- pnpm >= 8.15.0 (recommended package manager)
# Set your GitHub token
export GITHUB_TOKEN=your_github_token_here
# Update a package
node dist/cli.js my-org my-repo some-lib 1.2.3import { App } from 'github-package-updater';
const app = new App('your_github_token');
const result = await app.updatePackageAndCreatePR({
owner: 'my-org',
repo: 'my-repo',
packageName: 'some-lib',
newVersion: '1.2.3',
token: 'your_github_token',
});
console.log(`Pull request created: ${result.url}`);App requires a GitHub Personal Access Token with the following permissions:
repo- Full control of private repositoriespublic_repo- Access to public repositories
Set the token as an environment variable:
export GITHUB_TOKEN=your_token_here# Clone the repository
git clone <repository-url>
cd github-package-updater
# Install dependencies
pnpm install
# Build the project
pnpm run buildpnpm run build- Build TypeScript to JavaScriptpnpm run dev- Run in development mode with tsxpnpm test- Run testspnpm run test:watch- Run tests in watch modepnpm run lint- Lint code with ESLintpnpm run lint:fix- Fix linting issuespnpm run format- Format code with Prettierpnpm run format:check- Check code formatting
# Run all tests
pnpm test
# Run tests in watch mode
pnpm run test:watch
# Run tests with coverage
pnpm test -- --coverageApp provides specific error types for different failure scenarios:
AuthenticationError- GitHub authentication issuesPackageNotFoundError- Package not found in any dependency sectionRepositoryError- Repository access or operation failuresAppError- Base error class for all app-specific errors
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run the test suite
- Submit a pull request