Skip previews on PRs from forks#46
Conversation
📝 WalkthroughWalkthroughThe GitHub Actions workflow Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/codepreview.yml:
- Line 23: The workflow conditions reference github.event.pull_request.* even
when the workflow can be triggered by push, causing incorrect job skipping;
update the conditional expressions used in the preview/skip-if-fork job(s) to
first check the event type (e.g., ensure github.event_name == 'pull_request')
before accessing github.event.pull_request, for example by combining the checks
so the existing github.event.pull_request.head.repo.full_name ==
github.repository (and the similar check on Line 71) only runs when
github.event_name == 'pull_request'.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 70f863f9-16a8-4257-bcba-4fa622ea3273
📒 Files selected for processing (1)
.github/workflows/codepreview.yml
Due to security constraints, there is no way to generate previews from forks, let's skip the job instead of letting it fail.
6412412 to
88ed097
Compare
Due to security constraints, there is no way to generate previews from forks, let's skip the job instead of letting it fail.
Addressed Issues:
Screenshots/Recordings:
Codepreview step is not failing anymore:

On PRs from the same repo, codepreview runs as expected:
Additional Notes:
Checklist
AI Usage Disclosure
Check one of the checkboxes below:
I have used the following AI models and tools: TODO
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.
Summary by CodeRabbit