A test repository to verify all PR Watcher bot scenarios.
- 6 CI jobs (Test, Lint, Build, Security, Coverage, Integration)
- Environment variables to trigger failures
- Simple Node.js application
- Create a new GitHub repository
- Push this code to GitHub
- Enable GitHub Actions in repository settings
cd test-repo
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/YOUR_USERNAME/pr-watcher-test.git
git push -u origin main- Create a new branch and make a simple change
- Push and create a PR
- All checks should pass
- PR state will be "clean" → Bot will notify "✅ PR is ready to merge"
git checkout -b feature/test-success
echo "// Test change" >> index.js
git add .
git commit -m "Test: All checks passing"
git push origin feature/test-success- Create a branch with failing tests
- Set environment variable to fail a job
- Create PR
- Bot will notify "
⚠️ CI checks failed"
Option A: Fail tests in workflow
git checkout -b feature/test-failure
# Edit .github/workflows/ci.yml and add this to the test job:
# env:
# FAIL_TESTS: 'true'
git add .
git commit -m "Test: CI failure"
git push origin feature/test-failureOption B: Make test.js fail
git checkout -b feature/test-failure
# Edit test.js and change a test to fail, or add this line at the top:
# process.exit(1);
git add .
git commit -m "Test: CI failure"
git push origin feature/test-failure- Create a PR
- While PR is open, push new commits to main branch
- PR will be behind → mergeable_state becomes "behind"
- Bot will notify "🔄 PR needs rebase"
# Create PR from feature branch
git checkout -b feature/rebase-test
echo "// Feature change" >> index.js
git add .
git commit -m "Feature change"
git push origin feature/rebase-test
# Then update main branch (creates a conflict or just moves main ahead)
git checkout main
echo "// Main branch change" >> index.js
git add .
git commit -m "Update main"
git push origin main
# Now the PR will need rebase- Create PR with failing CI → Get "CI failed" notification
- Fix the CI → Get "Ready to merge" notification
- Update main branch → Get "Needs rebase" notification
- Rebase the PR → Get "Ready to merge" notification again
All 6 jobs run on every PR:
- Test - Runs unit tests
- Lint - Code style checks
- Build - Application build
- Security - Security vulnerability scan
- Coverage - Code coverage check
- Integration - Integration tests (depends on test, lint, build)
You can trigger failures by setting these in the workflow file:
FAIL_TESTS=true- Fail unit testsFAIL_LINT=true- Fail lintingFAIL_BUILD=true- Fail buildFAIL_SECURITY=true- Fail security checkFAIL_COVERAGE=true- Fail coverage check
# Test locally
npm test # Run tests
npm run lint # Run linting
npm run build # Build application
npm run security # Security check
npm run coverage # Coverage check