From 169cb83f69ed56022d5c949fcb78f604783990d7 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Sat, 14 Feb 2026 13:39:26 +0100 Subject: [PATCH] fix(pipeline): allow all tags and chore commits for releases --- .gitea/workflows/pipeline.yml | 10 +++++----- .husky/pre-push | 2 +- packages/infra/gitea/deploy-action.yml | 10 ++-------- scripts/sync-versions.ts | 8 ++++---- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/.gitea/workflows/pipeline.yml b/.gitea/workflows/pipeline.yml index eeeb87f..4f74318 100644 --- a/.gitea/workflows/pipeline.yml +++ b/.gitea/workflows/pipeline.yml @@ -5,7 +5,7 @@ on: branches: - '**' tags: - - 'v*' + - '*' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -30,7 +30,7 @@ jobs: echo "๐Ÿ”Ž Debug: Event=$EVENT, Ref=$REF, RefName=$REF_NAME, RunId=$RUN_ID" case "$REF" in - refs/tags/v*) + refs/tags/*) echo "๐Ÿš€ Release detected ($REF_NAME). Cancelling non-tag runs..." # Fetch all runs @@ -43,7 +43,7 @@ jobs: TITLE=$(echo "$run" | jq -r '.display_title') case "$RUN_REF" in - refs/tags/v*) + refs/tags/*) echo "โญ๏ธ Skipping parallel release run $ID ($TITLE) on $RUN_REF" ;; *) @@ -130,7 +130,7 @@ jobs: release: name: ๐Ÿš€ Release needs: [lint, test, build] - if: startsWith(github.ref, 'refs/tags/v') + if: startsWith(github.ref, 'refs/tags/') runs-on: docker container: image: catthehacker/ubuntu:act-latest @@ -160,7 +160,7 @@ jobs: build-images: name: ๐Ÿณ Build ${{ matrix.name }} needs: [lint, test, build] - if: startsWith(github.ref, 'refs/tags/v') + if: startsWith(github.ref, 'refs/tags/') runs-on: docker container: image: catthehacker/ubuntu:act-latest diff --git a/.husky/pre-push b/.husky/pre-push index 476d6ae..bb5228b 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -8,7 +8,7 @@ fi # Check if we are pushing a tag while read local_ref local_sha remote_ref remote_sha do - if [[ "$remote_ref" == refs/tags/v* ]]; then + if [[ "$remote_ref" == refs/tags/* ]]; then TAG=${remote_ref#refs/tags/} echo "๐Ÿท๏ธ Tag detected: $TAG, ensuring versions are synced..." diff --git a/packages/infra/gitea/deploy-action.yml b/packages/infra/gitea/deploy-action.yml index e82859a..35efce4 100644 --- a/packages/infra/gitea/deploy-action.yml +++ b/packages/infra/gitea/deploy-action.yml @@ -5,7 +5,7 @@ on: branches: - main tags: - - 'v*' + - '*' workflow_dispatch: inputs: skip_long_checks: @@ -65,11 +65,6 @@ jobs: PRJ_ID="${{ github.event.repository.name }}" if [[ "${{ github.ref_type }}" == "branch" && "$TAG" == "main" ]]; then - if [[ "$COMMIT_MSG" =~ ^chore: ]]; then - TARGET="skip" - GOTIFY_TITLE="โ„น๏ธ Skip Deploy (Chore)" - GOTIFY_PRIORITY=2 - else TARGET="testing" IMAGE_TAG="main-${SHORT_SHA}" ENV_FILE=".env.testing" @@ -81,9 +76,8 @@ jobs: IS_PROD="false" GOTIFY_TITLE="๐Ÿงช Testing-Deploy" GOTIFY_PRIORITY=4 - fi elif [[ "${{ github.ref_type }}" == "tag" ]]; then - if [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + if [[ "$TAG" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then TARGET="production" IMAGE_TAG="$TAG" ENV_FILE=".env.prod" diff --git a/scripts/sync-versions.ts b/scripts/sync-versions.ts index c51e6a6..2a63fb6 100644 --- a/scripts/sync-versions.ts +++ b/scripts/sync-versions.ts @@ -8,7 +8,7 @@ import { execSync } from "child_process"; */ function getVersionTag() { // 0. Check arguments (passed from husky hook or manual run) - const argTag = process.argv.slice(2).find((arg) => arg.startsWith("v")); + const argTag = process.argv.slice(2).find((arg) => arg.match(/^v?\d/)); if (argTag) { return argTag; } @@ -16,11 +16,11 @@ function getVersionTag() { // 1. Check CI environment variables if ( process.env.GITHUB_REF_NAME && - process.env.GITHUB_REF_NAME.startsWith("v") + process.env.GITHUB_REF_NAME.match(/^v?\d/) ) { return process.env.GITHUB_REF_NAME; } - if (process.env.TAG && process.env.TAG.startsWith("v")) { + if (process.env.TAG && process.env.TAG.match(/^v?\d/)) { return process.env.TAG; } @@ -29,7 +29,7 @@ function getVersionTag() { const gitTag = execSync("git describe --tags --abbrev=0", { encoding: "utf8", }).trim(); - if (gitTag && gitTag.startsWith("v")) { + if (gitTag && gitTag.match(/^v?\d/)) { return gitTag; } } catch (e) {