Skip to content

Commit e4604d9

Browse files
committed
Add sync-branches script and refactor ScanResults component
- Introduced a new script to automate branch synchronization and deployment processes, including auto-committing changes, pulling updates from the main branch, and building for GitHub Pages. - Refactored the ScanResults component to streamline dark mode functionality and improve the display of findings. - Enhanced the UI with a new layout for severity cards and findings, improving user experience and accessibility. - Updated handling of API limits and cache notifications for better user feedback.
1 parent aaf012c commit e4604d9

File tree

2 files changed

+109
-337
lines changed

2 files changed

+109
-337
lines changed

scripts/sync-branches.mjs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { execSync } from 'child_process';
2+
3+
function runCommand(command) {
4+
try {
5+
execSync(command, { stdio: 'inherit' });
6+
} catch (error) {
7+
console.error(`Failed to execute command: ${command}`);
8+
process.exit(1);
9+
}
10+
}
11+
12+
// First, commit any pending changes
13+
runCommand('git add .');
14+
runCommand('git commit -m "Auto-commit before sync"');
15+
16+
// Configure git pull strategy
17+
runCommand('git config pull.rebase false');
18+
19+
// Ensure we're on main branch and it's up to date
20+
runCommand('git checkout main');
21+
runCommand('git pull origin main');
22+
23+
// Sync development branch
24+
runCommand('git fetch origin development');
25+
runCommand('git checkout development');
26+
runCommand('git pull origin development');
27+
runCommand('git merge main --no-ff -m "Sync development with main"');
28+
runCommand('git push origin development');
29+
30+
// Install dependencies if needed
31+
runCommand('npm install');
32+
33+
// Build and sync gh-pages
34+
runCommand('git checkout development');
35+
runCommand('npm run build');
36+
runCommand('git add dist -f');
37+
runCommand('git commit -m "Build for gh-pages"');
38+
runCommand('npm run deploy');
39+
40+
// Return to main branch
41+
runCommand('git checkout main');
42+
43+
console.log('Successfully synced all branches!');

0 commit comments

Comments
 (0)