Skip to content

Bumping wrong version in pyproject.toml #238

@alac88

Description

@alac88

Hi,
I have the following configuration to automate changelog generation and release:

name: Release
on:
   push:
      branches:
         - main
jobs:
   changelog:
      runs-on: ubuntu-latest
      steps:
         - uses: actions/checkout@v3 # Checkout our working repository
         - name: Conventional Changelog Action # This action will look for conventional commits
           id: changelog
           uses: TriPSs/conventional-changelog-action@v3
           with:
              github-token: ${{ secrets.github_token }}
              version-file: "./package.json, ./pyproject.toml"

         - name: Create Release # This action will create the actual release
           uses: actions/create-release@v1
           if: ${{ steps.changelog.outputs.skipped == 'false' }}
           env:
              GITHUB_TOKEN: ${{ secrets.github_token }}
           with:
              tag_name: ${{ steps.changelog.outputs.tag }}
              release_name: ${{ steps.changelog.outputs.tag }}
              body: ${{ steps.changelog.outputs.clean_changelog }}

By specifying my pyproject.toml in the version files and even though a version is already specified in the first section, it does bump the version but on the very first line of the file like so:

version = "0.1.0"

[tool.poetry]
name = "My project"
version = "0.4.1"
[...]

However I would like it to bump the version in the first section instead:

[tool.poetry]
name = "My project"
version = "0.5.0"
[...]

Is there any way to only bump the targeted version?
Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions