From 1d3b524f724f791d50eebd735a3e18837f3efbf4 Mon Sep 17 00:00:00 2001 From: Patrick Schork <354473+pschork@users.noreply.github.com> Date: Fri, 31 May 2024 22:14:33 -0700 Subject: [PATCH] Fix tag regex --- .github/workflows/docker-publish-release.yaml | 12 ++++++++++-- GitVersion.yml | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish-release.yaml b/.github/workflows/docker-publish-release.yaml index f63e42eb77..d2d5037427 100644 --- a/.github/workflows/docker-publish-release.yaml +++ b/.github/workflows/docker-publish-release.yaml @@ -4,9 +4,15 @@ on: push: branches: - pschork/semver - - release/* + tags: + - v* pull_request: workflow_dispatch: + inputs: + ref: + description: "Branch or SHA" + required: false + type: string env: REGISTRY: ghcr.io @@ -23,6 +29,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: + ref: ${{ github.event.inputs.ref }} fetch-depth: 0 - name: Install GitVersion @@ -67,6 +74,7 @@ jobs: run: make docker-release-build if: ${{ success() }} + # Publish if manually triggered or when semver tag is pushed - name: Push docker image release run: make docker-release-push - if: github.event_name == 'workflow_dispatch' + if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v') diff --git a/GitVersion.yml b/GitVersion.yml index e596af7326..52981c4aca 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -19,7 +19,7 @@ branches: increment: None prevent-increment-of-merged-branch-version: true track-merge-target: false - regex: ^releases?[/-] + regex: ^v*|^releases?[/-] source-branches: - main - release