From fea300318db6cafe6bae7fc8710f007a2e792521 Mon Sep 17 00:00:00 2001 From: Iwan Eising Date: Thu, 13 Aug 2026 00:48:12 +0400 Subject: [PATCH 1/2] fix(workflow): fix tag checking for project-specific tag formats The semantic-version-calculate workflow was checking for global tags (v0.1.0) even for projects with project-specific tag formats (api-detector-core-v0.0.1). This caused the workflow to fail when: - A project uses a project-specific tag prefix (e.g., api-detector-core-) - A global tag with the same version number exists from another project The fix detects the project directory and uses the appropriate tag prefix: - For projects in subdirectories: -v - For root projects: v Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../workflows/semantic-version-calculate.yml | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/semantic-version-calculate.yml b/.github/workflows/semantic-version-calculate.yml index 8f46648..6add5f0 100644 --- a/.github/workflows/semantic-version-calculate.yml +++ b/.github/workflows/semantic-version-calculate.yml @@ -130,15 +130,26 @@ jobs: id: check_tag run: | VERSION="${{ steps.calculate_semantic_version.outputs.next_version }}" + PROJECT_DIR="${{ env.PROJECT_DIR || '.' }}" - # Check if tag exists with or without 'v' prefix + # Determine the tag prefix based on the project directory + # Projects in subdirectories use project-specific tag format: -v + # Root projects use the default format: v + if [ "$PROJECT_DIR" = "." ]; then + TAG_PREFIX="" + else + # Extract the directory name and use it as the tag prefix + TAG_PREFIX="$(basename "$PROJECT_DIR")-" + fi + + # Check if tag exists with the appropriate format TAG_EXISTS=false - if git rev-parse "refs/tags/${VERSION}" >/dev/null 2>&1; then + if git rev-parse "refs/tags/${TAG_PREFIX}${VERSION}" >/dev/null 2>&1; then TAG_EXISTS=true - EXISTING_TAG="${VERSION}" - elif git rev-parse "refs/tags/v${VERSION}" >/dev/null 2>&1; then + EXISTING_TAG="${TAG_PREFIX}${VERSION}" + elif git rev-parse "refs/tags/${TAG_PREFIX}v${VERSION}" >/dev/null 2>&1; then TAG_EXISTS=true - EXISTING_TAG="v${VERSION}" + EXISTING_TAG="${TAG_PREFIX}v${VERSION}" fi echo "tag_exists=${TAG_EXISTS}" >> "$GITHUB_OUTPUT" From d19a52fbd69ee2b86ac78e4d16b8508d92a26c9d Mon Sep 17 00:00:00 2001 From: Iwan Eising Date: Thu, 13 Aug 2026 00:53:56 +0400 Subject: [PATCH 2/2] fix: add missing newline at the end of Described.java --- .../main/java/com/arc_e_tect/gradle/detector/core/Described.java | 1 + 1 file changed, 1 insertion(+) diff --git a/api-detector-core/src/main/java/com/arc_e_tect/gradle/detector/core/Described.java b/api-detector-core/src/main/java/com/arc_e_tect/gradle/detector/core/Described.java index 7ef7b91..dd2fabf 100644 --- a/api-detector-core/src/main/java/com/arc_e_tect/gradle/detector/core/Described.java +++ b/api-detector-core/src/main/java/com/arc_e_tect/gradle/detector/core/Described.java @@ -25,3 +25,4 @@ public interface Described { */ String path(); } +