diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index be0ac0cd..a329d555 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -26,7 +26,6 @@ jobs: release: name: Create Release for Node.js Project runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' permissions: contents: write pull-requests: write @@ -88,6 +87,12 @@ jobs: GIT_AUTHOR_EMAIL: ${{ secrets.LERIAN_CI_CD_USER_EMAIL }} GIT_COMMITTER_NAME: ${{ secrets.LERIAN_CI_CD_USER_NAME }} GIT_COMMITTER_EMAIL: ${{ secrets.LERIAN_CI_CD_USER_EMAIL }} + + - name: Fail if no tag is generated + if: ${{ steps.semantic_release.outputs.semantic_tag == '' }} + run: | + echo -e "\033[31mNo new version was generated. Stopping the pipeline.\033[0m" + exit 1 build_and_publish: name: Build and Publish Docker Image @@ -146,9 +151,3 @@ jobs: file: ./Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} - - - name: Debug and Logs for Issues - if: failure() - run: | - echo "Debugging failed step..." - cat $GITHUB_WORKSPACE/debug.log