Skip to content

Prevent deployment of docs on forked repositories#1310

Closed
wsmoak wants to merge 1 commit intobmad-code-org:mainfrom
wsmoak:skip-docs-deploy-on-forks
Closed

Prevent deployment of docs on forked repositories#1310
wsmoak wants to merge 1 commit intobmad-code-org:mainfrom
wsmoak:skip-docs-deploy-on-forks

Conversation

@wsmoak
Copy link
Copy Markdown
Contributor

@wsmoak wsmoak commented Jan 12, 2026

Whenever I sync my fork of BMAD-METHOD I notice that all the GitHub Actions (Workflows) try to run.
Example: https://github.com/wsmoak/BMAD-METHOD/actions/runs/20866029502

Let's try to prevent the docs deployment from running on forks, since that is never going to work.

Inspired by: https://beckysweger.com/2025/01/02/skip-a-job-in-a.html

In another repository we tried
if: ${{ github.repository == 'the-organization/the-repository' }}
which seems like it should have worked, but it did not.

Add condition to prevent deployment of docs on forked repositories
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 12, 2026

📝 Walkthrough

Walkthrough

A conditional guard is added to the GitHub Actions docs workflow to prevent the deploy job from executing in forked repositories, using if: github.event.repository.fork != true along with preceding comments.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow Configuration
.github/workflows/docs.yaml
Added conditional guard if: github.event.repository.fork != true on deploy job to skip execution for forked repositories; included explanatory comments

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: adding a guard to prevent docs deployment on forked repositories, which matches the workflow modification shown in the summary.
Description check ✅ Passed The description directly explains the motivation for the change: preventing GitHub Actions workflows from running on forks where docs deployment won't work, which aligns with the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d4f6642 and 7029f23.

📒 Files selected for processing (1)
  • .github/workflows/docs.yaml
🔇 Additional comments (1)
.github/workflows/docs.yaml (1)

55-56: Condition looks correct for preventing deployment on forks.

The github.event.repository.fork != true condition is a good portable approach that doesn't require hardcoding the repository name.

One consideration: the build job will still run on forks (consuming CI minutes) even though deploy will be skipped. If you want to save CI resources on forks entirely, you could add the same condition to the build job. However, keeping the build running allows fork contributors to validate their docs changes, so the current approach is reasonable if that's desired.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Collaborator

@alexeyv alexeyv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we actually want this workflow to run on SOME forks

@wsmoak
Copy link
Copy Markdown
Contributor Author

wsmoak commented Jan 12, 2026

we actually want this workflow to run on SOME forks

There are other forks where you want the docs published when the main branch is synced? That's all I'm skipping here. Not the entire workflow, just that step.

Every time I sync my fork (which brings the main branch up to date) I get an email like this:
bmad-method-deploy-docs-workflolw-run-260110

And you can see the failures on the main branch in the actions on my fork:
https://github.com/wsmoak/BMAD-METHOD/actions

Copy link
Copy Markdown
Collaborator

@alexeyv alexeyv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed on bmad-core, I think that the right way to do it for docs is this:

if: ${{ github.repository == [official repo] || secrets.BMAD_ENABLE_DOCS == 'true' }}

quality workflow needs no guard, discord can be "if not fork", and the rest should probably be like docs, but use their own dummy secret names.

@wsmoak wsmoak marked this pull request as draft January 13, 2026 13:03
@bmadcode
Copy link
Copy Markdown
Collaborator

@wsmoak is this still and issue / can you update against latest and ensure its still valid?

@bmadcode
Copy link
Copy Markdown
Collaborator

bmadcode commented Feb 6, 2026

closing since no updates on this

@bmadcode bmadcode closed this Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants