-
Notifications
You must be signed in to change notification settings - Fork 185
fix(ci): disable docs-deploy job for fork PRs #6479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds an Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/docs-deploy.yml:
- Around line 27-28: The condition `if:
github.event.pull_request.head.repo.full_name == github.repository` fails for
non-pull_request events (push, merge_group) because github.event.pull_request is
null; change the conditional to only perform the fork check for pull_request
events, e.g. replace it with `if: github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository` so
push/merge_group always pass and PRs are gated by the fork check, and also fix
the comment typo "secrect" → "secret".
.github/workflows/docs-deploy.yml
Outdated
| # Cloudflare secrect does not work for fork PRs | ||
| if: github.event.pull_request.head.repo.full_name == github.repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Condition blocks push and merge_group events, breaking main deployment.
The github.event.pull_request context is null for push and merge_group events, so this condition evaluates to false for those triggers. This will prevent docs from being deployed when changes are pushed to main.
Also, minor typo: "secrect" → "secret".
🔧 Proposed fix
- # Cloudflare secrect does not work for fork PRs
- if: github.event.pull_request.head.repo.full_name == github.repository
+ # Cloudflare secret does not work for fork PRs
+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Cloudflare secrect does not work for fork PRs | |
| if: github.event.pull_request.head.repo.full_name == github.repository | |
| # Cloudflare secret does not work for fork PRs | |
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository |
🤖 Prompt for AI Agents
In @.github/workflows/docs-deploy.yml around lines 27 - 28, The condition `if:
github.event.pull_request.head.repo.full_name == github.repository` fails for
non-pull_request events (push, merge_group) because github.event.pull_request is
null; change the conditional to only perform the fork check for pull_request
events, e.g. replace it with `if: github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository` so
push/merge_group always pass and PRs are gated by the fork check, and also fix
the comment typo "secrect" → "secret".
✅ Confirmed as addressed by @hanabi1224
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hanabi1224, thank you for fixing the condition and the typo! 🎉
🧠 Learnings used
Learnt from: hanabi1224
Repo: ChainSafe/forest PR: 5930
File: build.rs:64-77
Timestamp: 2025-08-13T09:43:20.301Z
Learning: hanabi1224 prefers hard compile-time errors in build scripts rather than runtime safeguards or collision detection, believing it's better to fail fast and fix root causes of issues like malformed snapshot names.
Learnt from: hanabi1224
Repo: ChainSafe/forest PR: 6057
File: src/cli/subcommands/f3_cmd.rs:0-0
Timestamp: 2025-09-09T10:37:17.947Z
Learning: hanabi1224 prefers having default timeouts (like 10m for --no-progress-timeout) to prevent commands from hanging indefinitely, even when the timeout flag isn't explicitly provided by users. This fail-fast approach is preferred over requiring explicit flag usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai is the if condition correct now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hanabi1224, yes, the if condition is now correct! ✅
The current condition:
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}Works as intended:
- Push to main:
github.event_name != 'pull_request'istrue→ job runs ✅ - Merge group:
github.event_name != 'pull_request'istrue→ job runs ✅ - Same-repo PR: First condition is
false, butgithub.event.pull_request.head.repo.full_name == github.repositoryistrue→ job runs ✅ - Fork PR: Both conditions are
false→ job is skipped ✅
The comment is also accurate and the typo is fixed. This will properly deploy docs for all non-fork events while preventing fork PRs from attempting to use the Cloudflare secret.
🧠 Learnings used
Learnt from: hanabi1224
Repo: ChainSafe/forest PR: 5930
File: build.rs:64-77
Timestamp: 2025-08-13T09:43:20.301Z
Learning: hanabi1224 prefers hard compile-time errors in build scripts rather than runtime safeguards or collision detection, believing it's better to fail fast and fix root causes of issues like malformed snapshot names.
Learnt from: hanabi1224
Repo: ChainSafe/forest PR: 6057
File: src/cli/subcommands/f3_cmd.rs:0-0
Timestamp: 2025-09-09T10:37:17.947Z
Learning: hanabi1224 prefers having default timeouts (like 10m for --no-progress-timeout) to prevent commands from hanging indefinitely, even when the timeout flag isn't explicitly provided by users. This fail-fast approach is preferred over requiring explicit flag usage.
Pull request was converted to draft
4fc1e41 to
9698be2
Compare
9698be2 to
8fa09b2
Compare
| name: Deploy to Cloudflare Pages | ||
| runs-on: ubuntu-24.04-arm | ||
| # Enable workflow for non-PRs but disable workflow for fork PRs as Cloudflare secret does not work for fork PRs | ||
| if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this run on push?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
Summary of changes
Disable docs-deploy CI job for fork PRs as cloudflare secrect is inaccessible, to address failure https://github.com/ChainSafe/forest/actions/runs/21317189360/job/61376868088?pr=6455#step:7:7 in #6455
Changes introduced in this pull request:
Reference issue to close (if applicable)
Closes
Other information and links
Change checklist
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.