From 3cf735e37223d0590a98f119543a476ed4c64b93 Mon Sep 17 00:00:00 2001 From: Hector Castejon Diaz Date: Tue, 9 Jul 2024 08:15:22 +0200 Subject: [PATCH] Fixes --- .github/workflows/push.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index e01593d13..d58cafc21 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -44,19 +44,19 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Validate Tag run: | - MSG=$(git log --format=%B -n 1 ${{github.event.after}}) - TAG=$(echo MSG | sed 's/\[\(.*\)\].*/\1/') + MSG=$(git log --format=%B -n 1 ${{ github.event.pull_request.head.sha }}) + TAG=$(echo $MSG | sed -ne 's/\[\(.*\)\].*/\1/p') echo "Found tag {$TAG}" - LINE=$(cat .codegen/changelog_config.yml | grep "tag: \"\[$(echo $TAG)\]\"") - VALID=$([ -z "$TAG" ] && echo "False" || echo "True") - echo "::set-env name=VALID_TAG::${TAG}" - - - name: Valid Tag - if: ${{VALID}} != "true" - uses: actions/github-script@v3 - with: - script: | - core.setFailed('Invalid tag name') \ No newline at end of file + # Store in variable to hide the result from the console output + MATCH=$(cat .codegen/changelog_config.yml | grep "tag: \"\[$(echo $TAG)\]\"") + + - name: Log failure + if: failure() + run: | + echo "Invalid or missing tag in commit message" + exit 1 \ No newline at end of file