Skip to content

Commit f51409f

Browse files
aaronpowellCopilot
andcommitted
ci: add resolution guidance to plugin structure check
Provides two options: rebase onto staged (with exact commands using the contributor's branch name) or manually remove the files. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent fb1b9e1 commit f51409f

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

.github/workflows/check-plugin-structure.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ jobs:
7575
}
7676
7777
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+
7882
const body = [
7983
'⚠️ **Materialized files or symlinks detected in plugin directories**',
8084
'',
@@ -83,9 +87,32 @@ jobs:
8387
'- `README.md`',
8488
'',
8589
'Agent, command, and skill files are copied in automatically when publishing to `main`.',
86-
'Please remove the following:',
8790
'',
91+
'**Issues found:**',
8892
...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+
'```',
89116
].join('\n');
90117
91118
await github.rest.pulls.createReview({

0 commit comments

Comments
 (0)