Disable Workflows Script - Implementation Summary
February 9, 2026 · View on GitHub
Overview
Created a comprehensive Node.js script to disable GitHub Actions workflows across all repositories in a GitHub account EXCEPT for quantum-x-builder.
Files Created
1. Main Script
Location: scripts/disable-workflows-except-qxb.js
- Pure Node.js implementation (no external dependencies required)
- Uses GitHub REST API v3
- ~450 lines with comprehensive error handling
2. Full Documentation
Location: docs/DISABLE_WORKFLOWS_GUIDE.md
- Complete usage guide
- Prerequisites and setup instructions
- Troubleshooting section
- Security best practices
- Examples and workflows
3. Quick Reference
Location: DISABLE_WORKFLOWS_QUICK.md
- TL;DR commands
- Common usage patterns
- Quick troubleshooting
Features
Safety Features
✅ Automatic Protection: quantum-x-builder is hardcoded and will never be disabled
✅ Dry-Run Default: Defaults to preview mode if no mode specified
✅ Clear Reporting: Shows protected vs. processed repositories
✅ Error Handling: Graceful handling of API failures
✅ Rate Limiting: Built-in delays to avoid API throttling
Operation Modes
- Dry-Run Mode (
--dry-run): Preview changes without applying - Interactive Mode (
--interactive): Confirm each repository individually - Automatic Mode (
--auto): Disable all at once (except quantum-x-builder)
Flexibility
- Works with personal accounts and organizations
- No external npm dependencies (pure Node.js)
- Supports environment variables and command-line arguments
- Cross-platform compatible (Linux, Mac, Windows)
Usage Examples
1. Safe Preview (Recommended First)
export GITHUB_TOKEN=ghp_your_token_here
node scripts/disable-workflows-except-qxb.js --dry-run
2. Interactive Mode
node scripts/disable-workflows-except-qxb.js --interactive
3. Automatic Disable
node scripts/disable-workflows-except-qxb.js --auto
4. For Organization
node scripts/disable-workflows-except-qxb.js --owner InfinityXOneSystems --auto
Requirements
- Node.js 16+ (uses built-in
httpsandreadlinemodules) - GitHub Personal Access Token with scopes:
repo- Full control of private repositoriesworkflow- Update GitHub Action workflows
How to Get a Token
- Go to: https://github.com/settings/tokens
- Click "Generate new token (classic)"
- Name: "Disable Workflows Script"
- Select scopes:
repo,workflow - Generate and copy the token
What It Does
The script:
- Authenticates with GitHub API
- Lists all repositories for the specified owner
- Filters out
quantum-x-builder(hardcoded protection) - Checks which repositories have Actions enabled
- Disables Actions for each repository (except quantum-x-builder)
- Provides detailed reporting of results
API Calls Made
GET /user- Get authenticated user infoGET /users/{username}/repos- List user repositoriesGET /orgs/{org}/repos- List organization repositoriesGET /repos/{owner}/{repo}/actions/permissions- Check Actions statusPUT /repos/{owner}/{repo}/actions/permissions- Disable Actions
Output Example
╔════════════════════════════════════════════════════════════════╗
║ Disable GitHub Actions - Except quantum-x-builder ║
╚════════════════════════════════════════════════════════════════╝
🔐 Authenticated as: Neo
📁 Target owner: InfinityXOneSystems
🛡️ Protected repository: quantum-x-builder
⚙️ Mode: DRY RUN
📋 Fetching repositories for: InfinityXOneSystems...
✅ Found 25 repositories
📊 Repository Summary:
Total repositories: 25
Protected (excluded): 1
Will be processed: 24
🛡️ Protected repositories (Actions will remain enabled):
✓ InfinityXOneSystems/quantum-x-builder
🔍 Checking which repositories have Actions enabled...
• InfinityXOneSystems/repo1 - Actions ENABLED
• InfinityXOneSystems/repo2 - Actions ENABLED
• InfinityXOneSystems/repo3 - Actions already disabled
...
📋 Found 15 repositories with Actions enabled
🔧 Processing repositories...
[DRY RUN] Would disable Actions for: InfinityXOneSystems/repo1
[DRY RUN] Would disable Actions for: InfinityXOneSystems/repo2
...
╔════════════════════════════════════════════════════════════════╗
║ Operation Summary ║
╚════════════════════════════════════════════════════════════════╝
📊 Results:
Would disable: 15
Protected: 1 (quantum-x-builder)
💡 This was a dry run. Use --auto or --interactive to apply changes.
Security Considerations
- Token should be kept secure and never committed
- Use environment variables for token storage
- Script includes rate limiting to be nice to GitHub API
- All API calls are logged for audit purposes
- Protected repositories are hardcoded (can't be accidentally disabled)
Testing Performed
✅ Help command displays correctly ✅ Error handling works (missing token) ✅ Script is executable ✅ No external dependencies required ✅ Clear and informative output
Next Steps for Users
- Read the full guide:
docs/DISABLE_WORKFLOWS_GUIDE.md - Get a GitHub token with required scopes
- Run dry-run mode first to preview changes
- Choose appropriate mode based on needs
- Verify quantum-x-builder remains protected
Notes
- The script does NOT delete workflows, it just disables them
- Workflows can be re-enabled via GitHub UI or API
- quantum-x-builder is permanently protected in the script
- No npm packages needed - uses only Node.js built-ins
- Compatible with GitHub Free, Pro, Team, and Enterprise