From f729750347350fd8c41c9d8e9c482fbdc9d0e940 Mon Sep 17 00:00:00 2001 From: Kevin Deldycke Date: Sat, 6 Jan 2024 20:16:34 +0400 Subject: [PATCH] Use bump-my-version to remove admonition in changelog Refs: https://github.com/callowayproject/bump-my-version/issues/117 --- .github/workflows/changelog.yaml | 22 +++++----------------- changelog.md | 2 ++ requirements.txt | 2 +- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/.github/workflows/changelog.yaml b/.github/workflows/changelog.yaml index 30e96c680..091ad6855 100644 --- a/.github/workflows/changelog.yaml +++ b/.github/workflows/changelog.yaml @@ -144,24 +144,12 @@ jobs: --replace "...v{current_version}" ./changelog.md - name: Remove first warning message in changelog - shell: python # Matches first occurrence of a multi-line block of text delimited by triple-backticks (``````). - run: | - import re - from pathlib import Path - - file = Path("./changelog.md") - content = file.read_text() - - cleaned_content = re.sub( - r"^\`\`\`.*?\`\`\`\n\n", - "", - content, - count=1, - flags=re.MULTILINE | re.DOTALL - ) - - file.write_text(cleaned_content) + run: > + bump-my-version replace --no-configured-files --ignore-missing-version + --regex --search "^\\\`\\\`\\\`.*?\\\`\\\`\\\`\\n\\n" + --replace "" + ./changelog.md - name: Setup Git run: | git config --global user.name "${{ github.actor }}" diff --git a/changelog.md b/changelog.md index ee29f5aaa..7e1a0e20f 100644 --- a/changelog.md +++ b/changelog.md @@ -6,6 +6,8 @@ This version is not released yet and is under active development. ``` +- Use `bump-my-version` to remove admonition in changelog. + ## [2.24.1 (2024-01-06)](https://github.com/kdeldycke/workflows/compare/v2.24.0...v2.24.1) - Expose current and released version in metadata script. diff --git a/requirements.txt b/requirements.txt index eda72549c..92b42ae10 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ # All versions are pinned so we have ultimate control over reproducibility. autopep8 == 2.0.4 blacken-docs == 1.16.0 -bump-my-version == 0.16.0 +bump-my-version == 0.16.1 check-wheel-contents == 0.6.0 # https://mdformat.readthedocs.io/en/stable/users/plugins.html mdformat == 0.7.17