From 6dea0d311540624f05570b20cb7a8fac89c46d43 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Thu, 4 Jan 2024 14:40:09 +0530 Subject: [PATCH] (ci/cd) read pyproject version --- .github/workflows/read_pyproject_version.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/read_pyproject_version.yml b/.github/workflows/read_pyproject_version.yml index 652c080d0..a1e139f1d 100644 --- a/.github/workflows/read_pyproject_version.yml +++ b/.github/workflows/read_pyproject_version.yml @@ -1,11 +1,9 @@ name: Read Version from pyproject.toml on: - workflow_dispatch: - inputs: - tag: - description: "The tag version you want to build" - + push: + branches: + - main # Change this to the default branch of your repository jobs: read-version: @@ -25,7 +23,7 @@ jobs: - name: Read version from pyproject.toml id: read-version - run: echo "::set-output name=version::$(toml get pyproject.toml tool.commitizen.version)" + run: echo "::set-output name=version::$(python -c "import toml; print(toml.load('pyproject.toml')['tool']['commitizen']['version'])")" - name: Display version run: echo "Current version is ${{ steps.read-version.outputs.version }}"