|
75 | 75 | } |
76 | 76 |
|
77 | 77 | if (errors.length > 0) { |
| 78 | + const prBranch = context.payload.pull_request.head.ref; |
| 79 | + const prRepo = context.payload.pull_request.head.repo.full_name; |
| 80 | + const isFork = context.payload.pull_request.head.repo.fork; |
| 81 | +
|
78 | 82 | const body = [ |
79 | 83 | '⚠️ **Materialized files or symlinks detected in plugin directories**', |
80 | 84 | '', |
|
83 | 87 | '- `README.md`', |
84 | 88 | '', |
85 | 89 | 'Agent, command, and skill files are copied in automatically when publishing to `main`.', |
86 | | - 'Please remove the following:', |
87 | 90 | '', |
| 91 | + '**Issues found:**', |
88 | 92 | ...errors.map(e => `- ${e}`), |
| 93 | + '', |
| 94 | + '---', |
| 95 | + '', |
| 96 | + '### How to fix', |
| 97 | + '', |
| 98 | + 'It looks like your branch may be based on `main` (which contains materialized files). Here are two options:', |
| 99 | + '', |
| 100 | + '**Option 1: Rebase onto `staged`** (recommended if you have few commits)', |
| 101 | + '```bash', |
| 102 | + `git fetch origin staged`, |
| 103 | + `git rebase --onto origin/staged origin/main ${prBranch}`, |
| 104 | + `git push --force-with-lease`, |
| 105 | + '```', |
| 106 | + '', |
| 107 | + '**Option 2: Remove the extra files manually**', |
| 108 | + '```bash', |
| 109 | + '# Remove materialized files from plugin directories', |
| 110 | + 'find plugins/ -mindepth 2 -maxdepth 2 -type d \\( -name agents -o -name commands -o -name skills \\) -exec rm -rf {} +', |
| 111 | + '# Remove any symlinks', |
| 112 | + 'find plugins/ -type l -delete', |
| 113 | + 'git add -A && git commit -m "fix: remove materialized plugin files"', |
| 114 | + 'git push', |
| 115 | + '```', |
89 | 116 | ].join('\n'); |
90 | 117 |
|
91 | 118 | await github.rest.pulls.createReview({ |
|
0 commit comments