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>
This commit is contained in:
Geoff BourneandCopilot authored and GitHub committed 2026-07-19 13:59:52 -05:00
1 parent bb6212aa58
commit 5275a0517e
5 files changed
+22 -5

No files matched your search

+2 -1
View File
@@ -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
+6 -4
View File
@@ -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 }}
+1
View File
@@ -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}}"