From 5275a0517e2a8e395b9f428cb4ce013c4f05162f Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 19 Jul 2026 13:59:52 -0500 Subject: [PATCH] Apply fork-friendly workflow changes from docker-mc-proxy#361 (#664) - Use github.repository_owner instead of hardcoded 'itzg' for Docker Hub org - Add PUSH environment variable to control when images are pushed (only on itzg repo) - Update login conditions to only run on original repo (env.PUSH) - Add repository_owner check to issues-notify workflow These changes allow workflows to work correctly when the repository is forked. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/auto-release.yml | 3 ++- .github/workflows/build.yml | 10 ++++++---- .github/workflows/issues-notify.yml | 1 + CONTRIBUTING.md | 0 examples/two-servers/compose.yml | 13 +++++++++++++ 5 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 CONTRIBUTING.md create mode 100644 examples/two-servers/compose.yml diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 965bcbd..2042481 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -6,7 +6,8 @@ on: jobs: auto-release: runs-on: ubuntu-latest - if: github.repository == 'itzg/docker-minecraft-bedrock-server' + # If forked, changed to your username to enable auto-releases + if: github.repository_owner == 'itzg' permissions: # allow for creating releases/tags contents: write diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca488e4..6da0e7c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,9 +24,11 @@ on: jobs: build: runs-on: ubuntu-latest - if: github.repository == 'itzg/docker-minecraft-bedrock-server' env: IMAGE_BASE_NAME: minecraft-bedrock-server + # Assume they line up, but when forked change to your Docker Hub username + DOCKER_HUB_ORG: ${{ github.repository_owner }} + PUSH: ${{ github.repository_owner == 'itzg' }} steps: - name: Set up QEMU @@ -36,14 +38,14 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Login to DockerHub - if: github.event_name != 'pull_request' + if: env.PUSH && github.event_name != 'pull_request' uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Login to GHCR - if: github.event_name != 'pull_request' + if: env.PUSH && github.event_name != 'pull_request' uses: docker/login-action@v3.6.0 with: registry: ghcr.io @@ -69,7 +71,7 @@ jobs: - name: Build and push uses: docker/build-push-action@v4 with: - push: ${{ github.event_name != 'pull_request' }} + push: ${{ env.PUSH && github.event_name != 'pull_request' }} provenance: false platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/issues-notify.yml b/.github/workflows/issues-notify.yml index b8f976a..f93bbe9 100644 --- a/.github/workflows/issues-notify.yml +++ b/.github/workflows/issues-notify.yml @@ -10,6 +10,7 @@ on: jobs: notify: + if: github.repository_owner == 'itzg' uses: itzg/github-workflows/.github/workflows/issues-notify-discord.yml@main secrets: discordWebhook: "${{secrets.DISCORD_ISSUES_WEBHOOK}}" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..e69de29 diff --git a/examples/two-servers/compose.yml b/examples/two-servers/compose.yml new file mode 100644 index 0000000..1278552 --- /dev/null +++ b/examples/two-servers/compose.yml @@ -0,0 +1,13 @@ +services: + bds1: + image: itzg/minecraft-bedrock-server + environment: + EULA: true + ports: + - "19111:19132/udp" + bds2: + image: itzg/minecraft-bedrock-server + environment: + EULA: true + ports: + - "19222:19132/udp" \ No newline at end of file