Skip to content

Commit 2f87bb8

Browse files
authored
Don't deploy docs when working on a fork (#13278)
# Objective - Some developers enable Github Actions for their fork and commit directly to main. This triggers the `docs.yml` action, which attempts to deploy the documentation even if Github Pages is not enabled. (It also creates a `CNAME` file specific to Bevy and should not be used in forks, even for testing.) - For an example, see [this run](https://github.com/tychedelia/bevy/actions/runs/8978912060/job/24660082729). ## Solution - Only attempt to deploy docs when running from the main Bevy repository. - This does not affect us checking `cargo doc` on pull requests, since that it done in `ci.yml`. ## Testing It's difficult to test this, but you'd probably: 1. Fork Bevy 2. Cherry pick this PR's commits onto the main branch of your fork. 3. Push another commit to the main branch, triggering Github Actions. 4. Check the Github Actions job summary to ensure that the `build-and-deploy` job is skipped.
1 parent 64e1a78 commit 2f87bb8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

.github/workflows/docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ concurrency:
2727
jobs:
2828
build-and-deploy:
2929
runs-on: ubuntu-latest
30+
# Only run this job when on the main Bevy repository. Without this, it would also run on forks
31+
# where developers work on the main branch but have not enabled Github Pages.
32+
if: ${{ github.repository == 'bevyengine/bevy' }}
3033
environment:
3134
name: github-pages
3235
url: ${{ steps.deployment.outputs.page_url }}

0 commit comments

Comments
 (0)