fix(pipeline): allow all tags and chore commits for releases
All checks were successful
Monorepo Pipeline / ⚡ Prioritize Release (push) Successful in 1s
Monorepo Pipeline / 🧪 Test (push) Successful in 1m5s
Monorepo Pipeline / 🧹 Lint (push) Successful in 2m13s
Monorepo Pipeline / 🏗️ Build (push) Successful in 3m53s
Monorepo Pipeline / 🚀 Release (push) Has been skipped
Monorepo Pipeline / 🐳 Build Directus (Base) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Gatekeeper (Product) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Build-Base (push) Has been skipped
Monorepo Pipeline / 🐳 Build Production Runtime (push) Has been skipped

This commit is contained in:
2026-02-14 13:39:26 +01:00
parent f831a7e67e
commit 169cb83f69
4 changed files with 12 additions and 18 deletions

View File

@@ -5,7 +5,7 @@ on:
branches: branches:
- '**' - '**'
tags: tags:
- 'v*' - '*'
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
@@ -30,7 +30,7 @@ jobs:
echo "🔎 Debug: Event=$EVENT, Ref=$REF, RefName=$REF_NAME, RunId=$RUN_ID" echo "🔎 Debug: Event=$EVENT, Ref=$REF, RefName=$REF_NAME, RunId=$RUN_ID"
case "$REF" in case "$REF" in
refs/tags/v*) refs/tags/*)
echo "🚀 Release detected ($REF_NAME). Cancelling non-tag runs..." echo "🚀 Release detected ($REF_NAME). Cancelling non-tag runs..."
# Fetch all runs # Fetch all runs
@@ -43,7 +43,7 @@ jobs:
TITLE=$(echo "$run" | jq -r '.display_title') TITLE=$(echo "$run" | jq -r '.display_title')
case "$RUN_REF" in case "$RUN_REF" in
refs/tags/v*) refs/tags/*)
echo "⏭️ Skipping parallel release run $ID ($TITLE) on $RUN_REF" echo "⏭️ Skipping parallel release run $ID ($TITLE) on $RUN_REF"
;; ;;
*) *)
@@ -130,7 +130,7 @@ jobs:
release: release:
name: 🚀 Release name: 🚀 Release
needs: [lint, test, build] needs: [lint, test, build]
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/')
runs-on: docker runs-on: docker
container: container:
image: catthehacker/ubuntu:act-latest image: catthehacker/ubuntu:act-latest
@@ -160,7 +160,7 @@ jobs:
build-images: build-images:
name: 🐳 Build ${{ matrix.name }} name: 🐳 Build ${{ matrix.name }}
needs: [lint, test, build] needs: [lint, test, build]
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/')
runs-on: docker runs-on: docker
container: container:
image: catthehacker/ubuntu:act-latest image: catthehacker/ubuntu:act-latest

View File

@@ -8,7 +8,7 @@ fi
# Check if we are pushing a tag # Check if we are pushing a tag
while read local_ref local_sha remote_ref remote_sha while read local_ref local_sha remote_ref remote_sha
do do
if [[ "$remote_ref" == refs/tags/v* ]]; then if [[ "$remote_ref" == refs/tags/* ]]; then
TAG=${remote_ref#refs/tags/} TAG=${remote_ref#refs/tags/}
echo "🏷️ Tag detected: $TAG, ensuring versions are synced..." echo "🏷️ Tag detected: $TAG, ensuring versions are synced..."

View File

@@ -5,7 +5,7 @@ on:
branches: branches:
- main - main
tags: tags:
- 'v*' - '*'
workflow_dispatch: workflow_dispatch:
inputs: inputs:
skip_long_checks: skip_long_checks:
@@ -65,11 +65,6 @@ jobs:
PRJ_ID="${{ github.event.repository.name }}" PRJ_ID="${{ github.event.repository.name }}"
if [[ "${{ github.ref_type }}" == "branch" && "$TAG" == "main" ]]; then 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" TARGET="testing"
IMAGE_TAG="main-${SHORT_SHA}" IMAGE_TAG="main-${SHORT_SHA}"
ENV_FILE=".env.testing" ENV_FILE=".env.testing"
@@ -81,9 +76,8 @@ jobs:
IS_PROD="false" IS_PROD="false"
GOTIFY_TITLE="🧪 Testing-Deploy" GOTIFY_TITLE="🧪 Testing-Deploy"
GOTIFY_PRIORITY=4 GOTIFY_PRIORITY=4
fi
elif [[ "${{ github.ref_type }}" == "tag" ]]; then 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" TARGET="production"
IMAGE_TAG="$TAG" IMAGE_TAG="$TAG"
ENV_FILE=".env.prod" ENV_FILE=".env.prod"

View File

@@ -8,7 +8,7 @@ import { execSync } from "child_process";
*/ */
function getVersionTag() { function getVersionTag() {
// 0. Check arguments (passed from husky hook or manual run) // 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) { if (argTag) {
return argTag; return argTag;
} }
@@ -16,11 +16,11 @@ function getVersionTag() {
// 1. Check CI environment variables // 1. Check CI environment variables
if ( if (
process.env.GITHUB_REF_NAME && 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; 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; return process.env.TAG;
} }
@@ -29,7 +29,7 @@ function getVersionTag() {
const gitTag = execSync("git describe --tags --abbrev=0", { const gitTag = execSync("git describe --tags --abbrev=0", {
encoding: "utf8", encoding: "utf8",
}).trim(); }).trim();
if (gitTag && gitTag.startsWith("v")) { if (gitTag && gitTag.match(/^v?\d/)) {
return gitTag; return gitTag;
} }
} catch (e) { } catch (e) {