From 5f430858f2063fe5791ae742e0d8f8acdf635a75 Mon Sep 17 00:00:00 2001 From: Yellowcooln <12516003+yellowcooln@users.noreply.github.com> Date: Sun, 17 May 2026 22:29:37 -0400 Subject: [PATCH] ci: restrict docker publish workflow --- .github/workflows/docker-publish.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 104b761..2cddf91 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -5,9 +5,19 @@ on: branches: - main - dev + workflow_dispatch: + inputs: + image_repository: + description: "Docker image repository to publish to" + required: false + default: "pymcdev/pymc-repeater" jobs: docker: + if: | + github.event_name == 'workflow_dispatch' || + github.repository == 'rightup/pyMC_Repeater' || + github.repository == 'yellowcooln/pyMC_Repeater' runs-on: ubuntu-latest permissions: contents: read @@ -46,7 +56,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: pymcdev/pymc-repeater + images: ${{ github.event_name == 'workflow_dispatch' && inputs.image_repository || 'pymcdev/pymc-repeater' }} tags: | type=raw,value=main,enable=${{ github.ref == 'refs/heads/main' }} type=raw,value=dev,enable=${{ github.ref == 'refs/heads/dev' }} @@ -67,6 +77,7 @@ jobs: cache-to: type=gha,mode=max - name: Notify Home Assistant add-on repository + if: github.repository == 'rightup/pyMC_Repeater' env: DISPATCH_TOKEN: ${{ secrets.HA_ADDON_REPO_DISPATCH_TOKEN }} CHANNEL: ${{ github.ref_name }}