filetree-pro
Version:
A powerful file tree generator for VS Code and Cursor. Generate beautiful file trees in multiple formats with smart exclusions and custom configurations.
123 lines (82 loc) • 2.78 kB
Markdown
# 🔧 CI/CD Fix Summary
## 🎯 Issue Identified
**Problem:** Jobs were being skipped on Pull Requests even after tests passed.
**Root Cause:** The `package` job had a condition that **excluded pull requests**:
```yaml
# OLD (BROKEN)
if: (github.ref == 'refs/heads/main' && github.event_name == 'push') || github.event_name == 'release'
```
This meant:
- ✅ Runs on push to `main` branch
- ✅ Runs on release events
- ❌ **SKIPS** on pull requests
## ✅ Fix Applied
**Updated** the `package` job condition to include pull requests:
```yaml
# NEW (FIXED)
if: |
github.event_name == 'pull_request' ||
(github.ref == 'refs/heads/main' && github.event_name == 'push') ||
github.event_name == 'release'
```
Now:
- ✅ Runs on pull requests (test packaging)
- ✅ Runs on push to `main` (create artifact)
- ✅ Runs on releases (for publishing)
## 📊 Before vs After
### Before (Skipped on PRs)
```
PR Event → dev/fix
├─ ✅ Build & Test (27s)
├─ ⏭️ Package Extension (skipped)
├─ ⏭️ Publish Extension (skipped)
└─ ⏭️ Upload Release Asset (skipped)
```
### After (Tests Packaging on PRs)
```
PR Event → dev/fix
├─ ✅ Build & Test (27s)
├─ ✅ Package Extension (15s) ← NOW RUNS!
├─ ⏭️ Publish Extension (skipped - correct)
└─ ⏭️ Upload Release Asset (skipped - correct)
```
**Note:** Publish and Release Asset jobs **should** skip on PRs - they only run on actual releases.
## 🎯 What This Fixes
### ✅ Benefits:
1. **Early Detection:** Packaging issues caught during PR review
2. **Test Artifact:** VSIX file available for testing before merge
3. **Confidence:** Know the extension packages correctly before merging
4. **No Surprises:** Avoid packaging failures after merge to main
### ⚠️ Note on Other Jobs:
**These jobs SHOULD skip on PRs (by design):**
- **🚀 Publish Extension** - Only runs on GitHub releases
- **📎 Upload Release Asset** - Only runs on GitHub releases
**Why?** Publishing should only happen when you intentionally create a release, not on every PR or merge.
## 🚀 How to Use
### For Pull Requests:
1. Create PR → Pipeline runs automatically
2. View results: Build & Test + Package
3. Download VSIX artifact if needed
4. Merge when green ✅
### For Releases:
1. Merge PR to `main`
2. Update `package.json` version
3. Create GitHub release
4. Pipeline automatically publishes to:
- VS Code Marketplace
- Open VSX Registry
- GitHub release assets
## 📚 Documentation
Full details in: `/docs/CI-CD-EXPLAINED.md`
## 🎉 Status
- ✅ CI/CD workflow fixed
- ✅ Package job now runs on PRs
- ✅ Documentation created
- ✅ Ready to test on next PR
**Next PR will show all jobs running correctly!** 🚀