Skip to content

Commit 2cbb1b1

Browse files
committed
fix(ci): handle fork permission errors in plugin structure check
1 parent ce231b3 commit 2cbb1b1

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

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

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,31 @@ jobs:
153153
'```',
154154
].join('\n');
155155
156-
await github.rest.pulls.createReview({
157-
owner: context.repo.owner,
158-
repo: context.repo.repo,
159-
pull_number: context.issue.number,
160-
event: 'REQUEST_CHANGES',
161-
body
162-
});
156+
let reviewPosted = false;
157+
158+
if (!isFork) {
159+
try {
160+
await github.rest.pulls.createReview({
161+
owner: context.repo.owner,
162+
repo: context.repo.repo,
163+
pull_number: context.issue.number,
164+
event: 'REQUEST_CHANGES',
165+
body
166+
});
167+
reviewPosted = true;
168+
} catch (error) {
169+
core.warning(
170+
`Could not create PR review (continuing with failure report): ${error.message}`
171+
);
172+
}
173+
} else {
174+
core.warning('PR is from a fork; skipping createReview to avoid permission errors.');
175+
}
176+
177+
if (!reviewPosted) {
178+
core.warning('Materialized plugin issues detected. Full details:');
179+
core.warning(body);
180+
}
163181
164182
core.setFailed('Plugin directories contain materialized files or symlinks that should not be on staged');
165183
} else {

0 commit comments

Comments
 (0)