Repository: ruancomelli/brag-ai
Pull request #32: ci: add workflow for releasing a new version
Author: login: ruancomelli
Labels: name: size/L
Created: 2025-03-06T02:02:51Z | Merged: 2025-03-06T02:08:55Z

## Summary by Sourcery

Adds a new workflow to release new versions of the project, including updating the version in the `__init__.py` file, updating the changelog, and creating a GitHub release. Separates the publish and release workflows.

CI:
- Adds a new workflow for releasing new versions.
- Separates the `publish` and `release` workflows.
- Adds a composite action to get the current and next versions of the project.


Diff:
diff --git a/.github/actions/current-version/action.yaml b/.github/actions/current-version/action.yaml
new file mode 100644
index 0000000..ed3e161
--- /dev/null
+++ b/.github/actions/current-version/action.yaml
@@ -0,0 +1,54 @@
+name: Current Version
+description: Get the current version of the project
+outputs:
+  version:
+    description: The current version of the project
+    value: ${{ steps.current-version.outputs.result }}
+  next-version:
+    description: The next version of the project
+    value: ${{ steps.next-version.outputs.result }}
+  next-major-version:
+    description: The next major version of the project
+    value: ${{ steps.next-major-version.outputs.result }}
+  next-minor-version:
+    description: The next minor version of the project
+    value: ${{ steps.next-minor-version.outputs.result }}
+  next-patch-version:
+    description: The next patch version of the project
+    value: ${{ steps.next-patch-version.outputs.result }}
+
+runs:
+  using: composite
+  steps:
+  - name: Setup UV
+    uses: astral-sh/setup-uv@v5
+    with:
+      enable-cache: false
+
+  - name: Get current version
+    id: current-version
+    run: uvx hatch version
+    shell: bash
+
+  - name: Set up git-cliff
+    uses: kenji-miyake/setup-git-cliff@v1
+
+  - name: Get next version
+    id: next-version
+    run: git cliff --unreleased --bump --context | jq -r .[0].version
+    shell: bash
+
+  - name: Get next major version
+    id: next-major-version
+    run: git cliff --unreleased --bump major --context | jq -r .[0].version
+    shell: bash
+
+  - name: Get next minor version
+    id: next-minor-version
+    run: git cliff --unreleased --bump minor --context | jq -r .[0].version
+    shell: bash
+
+  - name: Get next patch version
+    id: next-patch-version
+    run: git cliff --unreleased --bump patch --context | jq -r .[0].version
+    shell: bash
diff --git a/.github/git-cliff-config.toml b/.github/git-cliff-config.toml
new file mode 100644
index 0000000..15e6f24
--- /dev/null
+++ b/.github/git-cliff-config.toml
@@ -0,0 +1,128 @@
+# git-cliff ~ configuration file
+# https://git-cliff.org/docs/configuration
+
+[remote.github]
+owner = "ruancomelli"
+repo = "brag-ai"
+
+[changelog]
+# A Tera template to be rendered as the changelog's header.
+# See https://keats.github.io/tera/docs/#introduction
+header = """
+# Changelog
+
+"""
+# A Tera template to be rendered for each release in the changelog.
+# See https://keats.github.io/tera/docs/#introduction
+body = """
+{%- macro remote_url() -%}
+  https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
+{%- endmacro -%}
+
+{% macro print_commit(commit) -%}
+    - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
+        {% if commit.breaking %}[**breaking**] {% endif %}\
+        {{ commit.message | upper_first }} - \
+        ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\
+{% endmacro -%}
+
+{% if version %}\
+    {% if previous.version %}\
+        ## [{{ version | trim_start_matches(pat="v") }}]\
+          ({{ self::remote_url() }}/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
+    {% else %}\
+        ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
+    {% endif %}\
+{% else %}\
+    ## [unreleased]
+{% endif %}\
+
+{% for group, commits in commits | group_by(attribute="group") %}
+    ### {{ group | striptags | trim | upper_first }}
+    {% for commit in commits
+    | filter(attribute="scope")
+    | sort(attribute="scope") %}
+        {{ self::print_commit(commit=commit) }}
+    {%- endfor %}
+    {% for commit in commits %}
+        {%- if not commit.scope -%}
+            {{ self::print_commit(commit=commit) }}
+        {% endif -%}
+    {% endfor -%}
+{% endfor -%}
+{%- if github -%}
+{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
+  ## New Contributors ❤️
+{% endif %}\
+{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
+  * @{{ contributor.username }} made their first contribution
+    {%- if contributor.pr_number %} in \
+      [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
+    {%- endif %}
+{%- endfor -%}
+{%- endif %}
+"""
+# A Tera template to be rendered as the changelog's footer.
+# See https://keats.github.io/tera/docs/#introduction
+footer = """
+<!-- generated by git-cliff -->
+"""
+# Remove leading and trailing whitespaces from the changelog's body.
+trim = true
+# An array of regex based postprocessors to modify the changelog.
+postprocessors = [
+	# Replace the placeholder `<REPO>` with a URL.
+	{ pattern = '<REPO>', replace = "https://github.com/ruancomelli/brag-ai" }, # replace repository URL
+]
+
+[git]
+# Parse commits according to the conventional commits specification.
+# See https://www.conventionalcommits.org
+conventional_commits = true
+# Exclude commits that do not match the conventional commits specification.
+filter_unconventional = true
+# Split commits on newlines, treating each line as an individual commit.
+split_commits = false
+# An array of regex based parsers to modify commit messages prior to further processing.
+commit_preprocessors = [
+	# Replace issue numbers with link templates to be updated in `changelog.postprocessors`.
+	{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" },
+	# Check spelling of the commit message using https://github.com/crate-ci/typos.
+	# If the spelling is incorrect, it will be fixed automatically.
+	# { pattern = '.*', replace_command = 'typos --write-changes -' },
+]
+# An array of regex based parsers for extracting data from the commit message.
+# Assigns commits to groups.
+# Optionally sets the commit's scope and can decide to exclude commits from further processing.
+commit_parsers = [
+	{ message = "^feat", group = "<!-- 0 -->✨ Features" },
+	{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
+	{ message = "^docs", group = "<!-- 2 -->📚 Documentation" },
+	{ message = "^perf", group = "<!-- 3 -->⚡ Performance" },
+	{ message = "^refactor", group = "<!-- 4 -->♻️ Refactor" },
+	{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
+	{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
+	{ message = "^build", group = "<!-- 7 -->🏗️ Build System" },
+	{ message = "^ci", group = "<!-- 8 -->🔄 CI/CD" },
+	{ message = "^chore\\(deps.*\\)", group = "<!-- 9 -->📦 Dependencies" },
+	{ message = "^chore", group = "<!-- 10 -->🔧 Chores" },
+	# Skip all commits that don't have a message
+	{ body = "$^", skip = true },
+]
+# Prevent commits that are breaking from being excluded by commit parsers.
+protect_breaking_commits = true
+# Exclude commits that are not matched by any commit parser.
+filter_commits = false
+# Regex to select git tags that represent releases.
+tag_pattern = "v[0-9].*"
+# Regex to select git tags that do not represent proper releases.
+# Takes precedence over `tag_pattern`.
+# Changes belonging to these releases will be included in the next release.
+skip_tags = "beta|alpha|rc"
+# Regex to exclude git tags after applying the tag_pattern.
+ignore_tags = ""
+# Order releases topologically instead of chronologically.
+topo_order = false
+# Order of commits in each group/release within the changelog.
+# Allowed values: newest, oldest
+sort_commits = "newest"
diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml
new file mode 100644
index 0000000..3b8e896
--- /dev/null
+++ b/.github/workflows/publish.yaml
@@ -0,0 +1,30 @@
+name: Publish release to PyPI
+
+on:
+  release:
+    types:
+    - created
+
+jobs:
+  pypi:
+    name: Publish to PyPI
+    runs-on: ubuntu-latest
+    environment:
+      name: release
+    permissions:
+      id-token: write
+    steps:
+    - uses: actions/checkout@v4
+      with:
+        persist-credentials: false
+    - uses: astral-sh/setup-uv@v5
+      with:
+        enable-cache: false
+    - name: Build package
+      run: uv build
+        # Check that basic features work and we didn't miss to include crucial files
+        # - name: Smoke test (wheel)
+        #   run: uv run --isolated --no-project -p 3.13 --with dist/*.whl tests/smoke_test.py
+        # - name: Smoke test (source distribution)
+        #   run: uv run --isolated --no-project -p 3.13 --with dist/*.tar.gz tests/smoke_test.py
+    - run: uv publish --trusted-publishing always
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
new file mode 100644
index 0000000..d0ed7dc
--- /dev/null
+++ b/.github/workflows/release.yaml
@@ -0,0 +1,95 @@
+name: Release
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: |
+          Release version without the v prefix (e.g. 0.1.0).
+          Can also be `major`, `minor`, or `patch`.
+          If not provided, the next version will be automatically calculated.
+        required: false
+        type: string
+
+jobs:
+  release:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        fetch-depth: 0
+        persist-credentials: false
+
+    - name: Set up UV
+      uses: astral-sh/setup-uv@v5
+      with:
+        enable-cache: false
+
+    - name: Get current version
+      id: current-version
+      uses: ./.github/actions/current-version
+
+    - name: Calculate new version
+      id: new-version
+      run: |
+        if [ -z "${{ github.event.inputs.version }}" ]; then
+          echo "No version provided, using next version from git-cliff"
+          version=${{ steps.current-version.outputs.next-version }}
+        elif [ "${{ github.event.inputs.version }}" = "major" ]; then
+          echo "Major version bump requested"
+          version=${{ steps.current-version.outputs.next-major-version }}
+        elif [ "${{ github.event.inputs.version }}" = "minor" ]; then
+          echo "Minor version bump requested"
+          version=${{ steps.current-version.outputs.next-minor-version }}
+        elif [ "${{ github.event.inputs.version }}" = "patch" ]; then
+          echo "Patch version bump requested"
+          version=${{ steps.current-version.outputs.next-patch-version }}
+        else
+          echo "Using specific version: ${{ github.event.inputs.version }}"
+          version=${{ github.event.inputs.version }}
+        fi
+        echo "version=$version" >> $GITHUB_OUTPUT
+
+    - name: Update version in __init__.py
+      run: |
+        echo "Updating version to ${{ steps.new-version.outputs.version }}"
+        sed -i 's/__version__ = ".*"/__version__ = "${{ steps.new-version.outputs.version }}"/' src/brag/__init__.py
+
+    - name: Update changelog with new version
+      uses: orhun/git-cliff-action@v3
+      id: update-changelog
+      with:
+        config: .github/git-cliff-config.toml
+        args: --tag v${{ steps.new-version.outputs.version }}
+      env:
+        OUTPUT: CHANGELOG.md
+
+    - name: Generate release changelog
+      uses: orhun/git-cliff-action@v3
+      id: generate-release-changelog
+      with:
+        config: .github/git-cliff-config.toml
+        args: -vv --latest
+
+    - name: Commit version and changelog
+      run: |
+        git add src/brag/__init__.py
+        git add CHANGELOG.md
+        git commit -m "chore: release v${{ steps.new-version.outputs.version }}"
+
+    - name: Push changes
+      run: |
+        git tag v${{ steps.new-version.outputs.version }}
+        git push origin main
+        git push origin v${{ steps.new-version.outputs.version }}
+
+    - name: Create GitHub Release
+      uses: softprops/action-gh-release@v2
+      with:
+        tag_name: v${{ steps.new-version.outputs.version }}
+        name: v${{ steps.new-version.outputs.version }}
+        body: ${{ steps.generate-release-changelog.outputs.content }}
+        token: ${{ secrets.GITHUB_TOKEN }}


Reviews:
user: login: github-advanced-security[bot]
state: COMMENTED
author_association: NONE
submitted_at: 2025-03-06T02:03:29Z
user: login: sourcery-ai[bot]
body: Hey @ruancomelli - I've reviewed your changes - here's some feedback:

**Overall Comments**:
- Consider using a single workflow with conditional steps instead of two separate workflows for release and publish.
- The `current-version` action could benefit from more error handling, especially around the `hatch version` and `git cliff` commands.

<details>
<summary>Here's what I looked at during the review</summary>

- 🟢 **General issues**: all looks good
- 🟢 **Security**: all looks good
- 🟢 **Review instructions**: all looks good
- 🟢 **Testing**: all looks good
- 🟢 **Complexity**: all looks good
- 🟢 **Documentation**: all looks good
</details>

***

<details>
<summary>Sourcery is free for open source - if you like our reviews please consider sharing them ✨</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20got%20an%20instant%20code%20review%20from%20%40SourceryAI%2C%20and%20it%20was%20brilliant%21%20It%27s%20free%20for%20open%20source%20and%20has%20a%20free%20trial%20for%20private%20code.%20Check%20it%20out%20https%3A//sourcery.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20got%20an%20instant%20code%20review%20from%20%40SourceryAI%2C%20and%20it%20was%20brilliant%21%20It%27s%20free%20for%20open%20source%20and%20has%20a%20free%20trial%20for%20private%20code.%20Check%20it%20out%20https%3A//sourcery.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https://sourcery.ai)
- [Facebook](https://www.facebook.com/sharer/sharer.php?u=https://sourcery.ai)

</details>

<sub>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
</sub>
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-06T02:03:47Z

Review comments:
diff_hunk: @@ -0,0 +1,95 @@
+name: Release
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: |
+          Release version without the v prefix (e.g. 0.1.0).
+          Can also be `major`, `minor`, or `patch`.
+          If not provided, the next version will be automatically calculated.
+        required: false
+        type: string
+
+jobs:
+  release:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        fetch-depth: 0
+        persist-credentials: false
+
+    - name: Set up UV
+      uses: astral-sh/setup-uv@v5
+      with:
+        enable-cache: false
+
+    - name: Get current version
+      id: current-version
+      uses: ./.github/actions/current-version
+
+    - name: Calculate new version
+      id: new-version
+      run: |
+        if [ -z "${{ github.event.inputs.version }}" ]; then
+          echo "No version provided, using next version from git-cliff"
+          version=${{ steps.current-version.outputs.next-version }}
+        elif [ "${{ github.event.inputs.version }}" = "major" ]; then
+          echo "Major version bump requested"
+          version=${{ steps.current-version.outputs.next-major-version }}
+        elif [ "${{ github.event.inputs.version }}" = "minor" ]; then
+          echo "Minor version bump requested"
+          version=${{ steps.current-version.outputs.next-minor-version }}
+        elif [ "${{ github.event.inputs.version }}" = "patch" ]; then
+          echo "Patch version bump requested"
+          version=${{ steps.current-version.outputs.next-patch-version }}
+        else
+          echo "Using specific version: ${{ github.event.inputs.version }}"
+          version=${{ github.event.inputs.version }}
+        fi
+        echo "version=$version" >> $GITHUB_OUTPUT
path: .github/workflows/release.yaml
user: login: github-advanced-security[bot]
body: github.event.inputs.version may expand into attacker-controllable code

[Show more details](https://github.com/ruancomelli/brag-ai/security/code-scanning/10)
created_at: 2025-03-06T02:03:28Z
author_association: NONE
diff_hunk: @@ -0,0 +1,95 @@
+name: Release
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: |
+          Release version without the v prefix (e.g. 0.1.0).
+          Can also be `major`, `minor`, or `patch`.
+          If not provided, the next version will be automatically calculated.
+        required: false
+        type: string
+
+jobs:
+  release:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        fetch-depth: 0
+        persist-credentials: false
+
+    - name: Set up UV
+      uses: astral-sh/setup-uv@v5
+      with:
+        enable-cache: false
+
+    - name: Get current version
+      id: current-version
+      uses: ./.github/actions/current-version
+
+    - name: Calculate new version
+      id: new-version
+      run: |
+        if [ -z "${{ github.event.inputs.version }}" ]; then
+          echo "No version provided, using next version from git-cliff"
+          version=${{ steps.current-version.outputs.next-version }}
+        elif [ "${{ github.event.inputs.version }}" = "major" ]; then
+          echo "Major version bump requested"
+          version=${{ steps.current-version.outputs.next-major-version }}
+        elif [ "${{ github.event.inputs.version }}" = "minor" ]; then
+          echo "Minor version bump requested"
+          version=${{ steps.current-version.outputs.next-minor-version }}
+        elif [ "${{ github.event.inputs.version }}" = "patch" ]; then
+          echo "Patch version bump requested"
+          version=${{ steps.current-version.outputs.next-patch-version }}
+        else
+          echo "Using specific version: ${{ github.event.inputs.version }}"
+          version=${{ github.event.inputs.version }}
+        fi
+        echo "version=$version" >> $GITHUB_OUTPUT
path: .github/workflows/release.yaml
user: login: github-advanced-security[bot]
body: steps.current-version.outputs.next-version may expand into attacker-controllable code

[Show more details](https://github.com/ruancomelli/brag-ai/security/code-scanning/11)
created_at: 2025-03-06T02:03:28Z
author_association: NONE
diff_hunk: @@ -0,0 +1,95 @@
+name: Release
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: |
+          Release version without the v prefix (e.g. 0.1.0).
+          Can also be `major`, `minor`, or `patch`.
+          If not provided, the next version will be automatically calculated.
+        required: false
+        type: string
+
+jobs:
+  release:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        fetch-depth: 0
+        persist-credentials: false
+
+    - name: Set up UV
+      uses: astral-sh/setup-uv@v5
+      with:
+        enable-cache: false
+
+    - name: Get current version
+      id: current-version
+      uses: ./.github/actions/current-version
+
+    - name: Calculate new version
+      id: new-version
+      run: |
+        if [ -z "${{ github.event.inputs.version }}" ]; then
+          echo "No version provided, using next version from git-cliff"
+          version=${{ steps.current-version.outputs.next-version }}
+        elif [ "${{ github.event.inputs.version }}" = "major" ]; then
+          echo "Major version bump requested"
+          version=${{ steps.current-version.outputs.next-major-version }}
+        elif [ "${{ github.event.inputs.version }}" = "minor" ]; then
+          echo "Minor version bump requested"
+          version=${{ steps.current-version.outputs.next-minor-version }}
+        elif [ "${{ github.event.inputs.version }}" = "patch" ]; then
+          echo "Patch version bump requested"
+          version=${{ steps.current-version.outputs.next-patch-version }}
+        else
+          echo "Using specific version: ${{ github.event.inputs.version }}"
+          version=${{ github.event.inputs.version }}
+        fi
+        echo "version=$version" >> $GITHUB_OUTPUT
path: .github/workflows/release.yaml
user: login: github-advanced-security[bot]
body: github.event.inputs.version may expand into attacker-controllable code

[Show more details](https://github.com/ruancomelli/brag-ai/security/code-scanning/12)
created_at: 2025-03-06T02:03:28Z
author_association: NONE
diff_hunk: @@ -0,0 +1,95 @@
+name: Release
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: |
+          Release version without the v prefix (e.g. 0.1.0).
+          Can also be `major`, `minor`, or `patch`.
+          If not provided, the next version will be automatically calculated.
+        required: false
+        type: string
+
+jobs:
+  release:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        fetch-depth: 0
+        persist-credentials: false
+
+    - name: Set up UV
+      uses: astral-sh/setup-uv@v5
+      with:
+        enable-cache: false
+
+    - name: Get current version
+      id: current-version
+      uses: ./.github/actions/current-version
+
+    - name: Calculate new version
+      id: new-version
+      run: |
+        if [ -z "${{ github.event.inputs.version }}" ]; then
+          echo "No version provided, using next version from git-cliff"
+          version=${{ steps.current-version.outputs.next-version }}
+        elif [ "${{ github.event.inputs.version }}" = "major" ]; then
+          echo "Major version bump requested"
+          version=${{ steps.current-version.outputs.next-major-version }}
+        elif [ "${{ github.event.inputs.version }}" = "minor" ]; then
+          echo "Minor version bump requested"
+          version=${{ steps.current-version.outputs.next-minor-version }}
+        elif [ "${{ github.event.inputs.version }}" = "patch" ]; then
+          echo "Patch version bump requested"
+          version=${{ steps.current-version.outputs.next-patch-version }}
+        else
+          echo "Using specific version: ${{ github.event.inputs.version }}"
+          version=${{ github.event.inputs.version }}
+        fi
+        echo "version=$version" >> $GITHUB_OUTPUT
path: .github/workflows/release.yaml
user: login: github-advanced-security[bot]
body: steps.current-version.outputs.next-major-version may expand into attacker-controllable code

[Show more details](https://github.com/ruancomelli/brag-ai/security/code-scanning/13)
created_at: 2025-03-06T02:03:28Z
author_association: NONE
diff_hunk: @@ -0,0 +1,95 @@
+name: Release
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: |
+          Release version without the v prefix (e.g. 0.1.0).
+          Can also be `major`, `minor`, or `patch`.
+          If not provided, the next version will be automatically calculated.
+        required: false
+        type: string
+
+jobs:
+  release:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        fetch-depth: 0
+        persist-credentials: false
+
+    - name: Set up UV
+      uses: astral-sh/setup-uv@v5
+      with:
+        enable-cache: false
+
+    - name: Get current version
+      id: current-version
+      uses: ./.github/actions/current-version
+
+    - name: Calculate new version
+      id: new-version
+      run: |
+        if [ -z "${{ github.event.inputs.version }}" ]; then
+          echo "No version provided, using next version from git-cliff"
+          version=${{ steps.current-version.outputs.next-version }}
+        elif [ "${{ github.event.inputs.version }}" = "major" ]; then
+          echo "Major version bump requested"
+          version=${{ steps.current-version.outputs.next-major-version }}
+        elif [ "${{ github.event.inputs.version }}" = "minor" ]; then
+          echo "Minor version bump requested"
+          version=${{ steps.current-version.outputs.next-minor-version }}
+        elif [ "${{ github.event.inputs.version }}" = "patch" ]; then
+          echo "Patch version bump requested"
+          version=${{ steps.current-version.outputs.next-patch-version }}
+        else
+          echo "Using specific version: ${{ github.event.inputs.version }}"
+          version=${{ github.event.inputs.version }}
+        fi
+        echo "version=$version" >> $GITHUB_OUTPUT
path: .github/workflows/release.yaml
user: login: github-advanced-security[bot]
body: github.event.inputs.version may expand into attacker-controllable code

[Show more details](https://github.com/ruancomelli/brag-ai/security/code-scanning/14)
created_at: 2025-03-06T02:03:28Z
author_association: NONE
diff_hunk: @@ -0,0 +1,95 @@
+name: Release
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: |
+          Release version without the v prefix (e.g. 0.1.0).
+          Can also be `major`, `minor`, or `patch`.
+          If not provided, the next version will be automatically calculated.
+        required: false
+        type: string
+
+jobs:
+  release:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        fetch-depth: 0
+        persist-credentials: false
+
+    - name: Set up UV
+      uses: astral-sh/setup-uv@v5
+      with:
+        enable-cache: false
+
+    - name: Get current version
+      id: current-version
+      uses: ./.github/actions/current-version
+
+    - name: Calculate new version
+      id: new-version
+      run: |
+        if [ -z "${{ github.event.inputs.version }}" ]; then
+          echo "No version provided, using next version from git-cliff"
+          version=${{ steps.current-version.outputs.next-version }}
+        elif [ "${{ github.event.inputs.version }}" = "major" ]; then
+          echo "Major version bump requested"
+          version=${{ steps.current-version.outputs.next-major-version }}
+        elif [ "${{ github.event.inputs.version }}" = "minor" ]; then
+          echo "Minor version bump requested"
+          version=${{ steps.current-version.outputs.next-minor-version }}
+        elif [ "${{ github.event.inputs.version }}" = "patch" ]; then
+          echo "Patch version bump requested"
+          version=${{ steps.current-version.outputs.next-patch-version }}
+        else
+          echo "Using specific version: ${{ github.event.inputs.version }}"
+          version=${{ github.event.inputs.version }}
+        fi
+        echo "version=$version" >> $GITHUB_OUTPUT
path: .github/workflows/release.yaml
user: login: github-advanced-security[bot]
body: steps.current-version.outputs.next-minor-version may expand into attacker-controllable code

[Show more details](https://github.com/ruancomelli/brag-ai/security/code-scanning/15)
created_at: 2025-03-06T02:03:28Z
author_association: NONE
diff_hunk: @@ -0,0 +1,95 @@
+name: Release
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: |
+          Release version without the v prefix (e.g. 0.1.0).
+          Can also be `major`, `minor`, or `patch`.
+          If not provided, the next version will be automatically calculated.
+        required: false
+        type: string
+
+jobs:
+  release:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        fetch-depth: 0
+        persist-credentials: false
+
+    - name: Set up UV
+      uses: astral-sh/setup-uv@v5
+      with:
+        enable-cache: false
+
+    - name: Get current version
+      id: current-version
+      uses: ./.github/actions/current-version
+
+    - name: Calculate new version
+      id: new-version
+      run: |
+        if [ -z "${{ github.event.inputs.version }}" ]; then
+          echo "No version provided, using next version from git-cliff"
+          version=${{ steps.current-version.outputs.next-version }}
+        elif [ "${{ github.event.inputs.version }}" = "major" ]; then
+          echo "Major version bump requested"
+          version=${{ steps.current-version.outputs.next-major-version }}
+        elif [ "${{ github.event.inputs.version }}" = "minor" ]; then
+          echo "Minor version bump requested"
+          version=${{ steps.current-version.outputs.next-minor-version }}
+        elif [ "${{ github.event.inputs.version }}" = "patch" ]; then
+          echo "Patch version bump requested"
+          version=${{ steps.current-version.outputs.next-patch-version }}
+        else
+          echo "Using specific version: ${{ github.event.inputs.version }}"
+          version=${{ github.event.inputs.version }}
+        fi
+        echo "version=$version" >> $GITHUB_OUTPUT
path: .github/workflows/release.yaml
user: login: github-advanced-security[bot]
body: github.event.inputs.version may expand into attacker-controllable code

[Show more details](https://github.com/ruancomelli/brag-ai/security/code-scanning/16)
created_at: 2025-03-06T02:03:28Z
author_association: NONE
diff_hunk: @@ -0,0 +1,95 @@
+name: Release
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: |
+          Release version without the v prefix (e.g. 0.1.0).
+          Can also be `major`, `minor`, or `patch`.
+          If not provided, the next version will be automatically calculated.
+        required: false
+        type: string
+
+jobs:
+  release:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        fetch-depth: 0
+        persist-credentials: false
+
+    - name: Set up UV
+      uses: astral-sh/setup-uv@v5
+      with:
+        enable-cache: false
+
+    - name: Get current version
+      id: current-version
+      uses: ./.github/actions/current-version
+
+    - name: Calculate new version
+      id: new-version
+      run: |
+        if [ -z "${{ github.event.inputs.version }}" ]; then
+          echo "No version provided, using next version from git-cliff"
+          version=${{ steps.current-version.outputs.next-version }}
+        elif [ "${{ github.event.inputs.version }}" = "major" ]; then
+          echo "Major version bump requested"
+          version=${{ steps.current-version.outputs.next-major-version }}
+        elif [ "${{ github.event.inputs.version }}" = "minor" ]; then
+          echo "Minor version bump requested"
+          version=${{ steps.current-version.outputs.next-minor-version }}
+        elif [ "${{ github.event.inputs.version }}" = "patch" ]; then
+          echo "Patch version bump requested"
+          version=${{ steps.current-version.outputs.next-patch-version }}
+        else
+          echo "Using specific version: ${{ github.event.inputs.version }}"
+          version=${{ github.event.inputs.version }}
+        fi
+        echo "version=$version" >> $GITHUB_OUTPUT
path: .github/workflows/release.yaml
user: login: github-advanced-security[bot]
body: steps.current-version.outputs.next-patch-version may expand into attacker-controllable code

[Show more details](https://github.com/ruancomelli/brag-ai/security/code-scanning/17)
created_at: 2025-03-06T02:03:28Z
author_association: NONE
diff_hunk: @@ -0,0 +1,95 @@
+name: Release
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: |
+          Release version without the v prefix (e.g. 0.1.0).
+          Can also be `major`, `minor`, or `patch`.
+          If not provided, the next version will be automatically calculated.
+        required: false
+        type: string
+
+jobs:
+  release:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        fetch-depth: 0
+        persist-credentials: false
+
+    - name: Set up UV
+      uses: astral-sh/setup-uv@v5
+      with:
+        enable-cache: false
+
+    - name: Get current version
+      id: current-version
+      uses: ./.github/actions/current-version
+
+    - name: Calculate new version
+      id: new-version
+      run: |
+        if [ -z "${{ github.event.inputs.version }}" ]; then
+          echo "No version provided, using next version from git-cliff"
+          version=${{ steps.current-version.outputs.next-version }}
+        elif [ "${{ github.event.inputs.version }}" = "major" ]; then
+          echo "Major version bump requested"
+          version=${{ steps.current-version.outputs.next-major-version }}
+        elif [ "${{ github.event.inputs.version }}" = "minor" ]; then
+          echo "Minor version bump requested"
+          version=${{ steps.current-version.outputs.next-minor-version }}
+        elif [ "${{ github.event.inputs.version }}" = "patch" ]; then
+          echo "Patch version bump requested"
+          version=${{ steps.current-version.outputs.next-patch-version }}
+        else
+          echo "Using specific version: ${{ github.event.inputs.version }}"
+          version=${{ github.event.inputs.version }}
+        fi
+        echo "version=$version" >> $GITHUB_OUTPUT
path: .github/workflows/release.yaml
user: login: github-advanced-security[bot]
body: github.event.inputs.version may expand into attacker-controllable code

[Show more details](https://github.com/ruancomelli/brag-ai/security/code-scanning/18)
created_at: 2025-03-06T02:03:28Z
author_association: NONE
diff_hunk: @@ -0,0 +1,95 @@
+name: Release
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: |
+          Release version without the v prefix (e.g. 0.1.0).
+          Can also be `major`, `minor`, or `patch`.
+          If not provided, the next version will be automatically calculated.
+        required: false
+        type: string
+
+jobs:
+  release:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        fetch-depth: 0
+        persist-credentials: false
+
+    - name: Set up UV
+      uses: astral-sh/setup-uv@v5
+      with:
+        enable-cache: false
+
+    - name: Get current version
+      id: current-version
+      uses: ./.github/actions/current-version
+
+    - name: Calculate new version
+      id: new-version
+      run: |
+        if [ -z "${{ github.event.inputs.version }}" ]; then
+          echo "No version provided, using next version from git-cliff"
+          version=${{ steps.current-version.outputs.next-version }}
+        elif [ "${{ github.event.inputs.version }}" = "major" ]; then
+          echo "Major version bump requested"
+          version=${{ steps.current-version.outputs.next-major-version }}
+        elif [ "${{ github.event.inputs.version }}" = "minor" ]; then
+          echo "Minor version bump requested"
+          version=${{ steps.current-version.outputs.next-minor-version }}
+        elif [ "${{ github.event.inputs.version }}" = "patch" ]; then
+          echo "Patch version bump requested"
+          version=${{ steps.current-version.outputs.next-patch-version }}
+        else
+          echo "Using specific version: ${{ github.event.inputs.version }}"
+          version=${{ github.event.inputs.version }}
+        fi
+        echo "version=$version" >> $GITHUB_OUTPUT
path: .github/workflows/release.yaml
user: login: github-advanced-security[bot]
body: github.event.inputs.version may expand into attacker-controllable code

[Show more details](https://github.com/ruancomelli/brag-ai/security/code-scanning/19)
created_at: 2025-03-06T02:03:29Z
author_association: NONE
diff_hunk: @@ -0,0 +1,95 @@
+name: Release
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: |
+          Release version without the v prefix (e.g. 0.1.0).
+          Can also be `major`, `minor`, or `patch`.
+          If not provided, the next version will be automatically calculated.
+        required: false
+        type: string
+
+jobs:
+  release:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        fetch-depth: 0
+        persist-credentials: false
+
+    - name: Set up UV
+      uses: astral-sh/setup-uv@v5
+      with:
+        enable-cache: false
+
+    - name: Get current version
+      id: current-version
+      uses: ./.github/actions/current-version
+
+    - name: Calculate new version
+      id: new-version
+      run: |
+        if [ -z "${{ github.event.inputs.version }}" ]; then
+          echo "No version provided, using next version from git-cliff"
+          version=${{ steps.current-version.outputs.next-version }}
+        elif [ "${{ github.event.inputs.version }}" = "major" ]; then
+          echo "Major version bump requested"
+          version=${{ steps.current-version.outputs.next-major-version }}
+        elif [ "${{ github.event.inputs.version }}" = "minor" ]; then
+          echo "Minor version bump requested"
+          version=${{ steps.current-version.outputs.next-minor-version }}
+        elif [ "${{ github.event.inputs.version }}" = "patch" ]; then
+          echo "Patch version bump requested"
+          version=${{ steps.current-version.outputs.next-patch-version }}
+        else
+          echo "Using specific version: ${{ github.event.inputs.version }}"
+          version=${{ github.event.inputs.version }}
+        fi
+        echo "version=$version" >> $GITHUB_OUTPUT
+
+    - name: Update version in __init__.py
+      run: |
+        echo "Updating version to ${{ steps.new-version.outputs.version }}"
+        sed -i 's/__version__ = ".*"/__version__ = "${{ steps.new-version.outputs.version }}"/' src/brag/__init__.py
path: .github/workflows/release.yaml
user: login: github-advanced-security[bot]
body: steps.new-version.outputs.version may expand into attacker-controllable code

[Show more details](https://github.com/ruancomelli/brag-ai/security/code-scanning/20)
created_at: 2025-03-06T02:03:29Z
author_association: NONE
diff_hunk: @@ -0,0 +1,95 @@
+name: Release
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: |
+          Release version without the v prefix (e.g. 0.1.0).
+          Can also be `major`, `minor`, or `patch`.
+          If not provided, the next version will be automatically calculated.
+        required: false
+        type: string
+
+jobs:
+  release:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        fetch-depth: 0
+        persist-credentials: false
+
+    - name: Set up UV
+      uses: astral-sh/setup-uv@v5
+      with:
+        enable-cache: false
+
+    - name: Get current version
+      id: current-version
+      uses: ./.github/actions/current-version
+
+    - name: Calculate new version
+      id: new-version
+      run: |
+        if [ -z "${{ github.event.inputs.version }}" ]; then
+          echo "No version provided, using next version from git-cliff"
+          version=${{ steps.current-version.outputs.next-version }}
+        elif [ "${{ github.event.inputs.version }}" = "major" ]; then
+          echo "Major version bump requested"
+          version=${{ steps.current-version.outputs.next-major-version }}
+        elif [ "${{ github.event.inputs.version }}" = "minor" ]; then
+          echo "Minor version bump requested"
+          version=${{ steps.current-version.outputs.next-minor-version }}
+        elif [ "${{ github.event.inputs.version }}" = "patch" ]; then
+          echo "Patch version bump requested"
+          version=${{ steps.current-version.outputs.next-patch-version }}
+        else
+          echo "Using specific version: ${{ github.event.inputs.version }}"
+          version=${{ github.event.inputs.version }}
+        fi
+        echo "version=$version" >> $GITHUB_OUTPUT
+
+    - name: Update version in __init__.py
+      run: |
+        echo "Updating version to ${{ steps.new-version.outputs.version }}"
+        sed -i 's/__version__ = ".*"/__version__ = "${{ steps.new-version.outputs.version }}"/' src/brag/__init__.py
path: .github/workflows/release.yaml
user: login: github-advanced-security[bot]
body: steps.new-version.outputs.version may expand into attacker-controllable code

[Show more details](https://github.com/ruancomelli/brag-ai/security/code-scanning/21)
created_at: 2025-03-06T02:03:29Z
author_association: NONE
diff_hunk: @@ -0,0 +1,95 @@
+name: Release
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: |
+          Release version without the v prefix (e.g. 0.1.0).
+          Can also be `major`, `minor`, or `patch`.
+          If not provided, the next version will be automatically calculated.
+        required: false
+        type: string
+
+jobs:
+  release:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        fetch-depth: 0
+        persist-credentials: false
+
+    - name: Set up UV
+      uses: astral-sh/setup-uv@v5
+      with:
+        enable-cache: false
+
+    - name: Get current version
+      id: current-version
+      uses: ./.github/actions/current-version
+
+    - name: Calculate new version
+      id: new-version
+      run: |
+        if [ -z "${{ github.event.inputs.version }}" ]; then
+          echo "No version provided, using next version from git-cliff"
+          version=${{ steps.current-version.outputs.next-version }}
+        elif [ "${{ github.event.inputs.version }}" = "major" ]; then
+          echo "Major version bump requested"
+          version=${{ steps.current-version.outputs.next-major-version }}
+        elif [ "${{ github.event.inputs.version }}" = "minor" ]; then
+          echo "Minor version bump requested"
+          version=${{ steps.current-version.outputs.next-minor-version }}
+        elif [ "${{ github.event.inputs.version }}" = "patch" ]; then
+          echo "Patch version bump requested"
+          version=${{ steps.current-version.outputs.next-patch-version }}
+        else
+          echo "Using specific version: ${{ github.event.inputs.version }}"
+          version=${{ github.event.inputs.version }}
+        fi
+        echo "version=$version" >> $GITHUB_OUTPUT
+
+    - name: Update version in __init__.py
+      run: |
+        echo "Updating version to ${{ steps.new-version.outputs.version }}"
+        sed -i 's/__version__ = ".*"/__version__ = "${{ steps.new-version.outputs.version }}"/' src/brag/__init__.py
+
+    - name: Update changelog with new version
+      uses: orhun/git-cliff-action@v3
+      id: update-changelog
+      with:
+        config: .github/git-cliff-config.toml
+        args: --tag v${{ steps.new-version.outputs.version }}
+      env:
+        OUTPUT: CHANGELOG.md
+
+    - name: Generate release changelog
+      uses: orhun/git-cliff-action@v3
+      id: generate-release-changelog
+      with:
+        config: .github/git-cliff-config.toml
+        args: -vv --latest
+
+    - name: Commit version and changelog
+      run: |
+        git add src/brag/__init__.py
+        git add CHANGELOG.md
+        git commit -m "chore: release v${{ steps.new-version.outputs.version }}"
path: .github/workflows/release.yaml
user: login: github-advanced-security[bot]
body: steps.new-version.outputs.version may expand into attacker-controllable code

[Show more details](https://github.com/ruancomelli/brag-ai/security/code-scanning/22)
created_at: 2025-03-06T02:03:29Z
author_association: NONE
diff_hunk: @@ -0,0 +1,95 @@
+name: Release
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: |
+          Release version without the v prefix (e.g. 0.1.0).
+          Can also be `major`, `minor`, or `patch`.
+          If not provided, the next version will be automatically calculated.
+        required: false
+        type: string
+
+jobs:
+  release:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        fetch-depth: 0
+        persist-credentials: false
+
+    - name: Set up UV
+      uses: astral-sh/setup-uv@v5
+      with:
+        enable-cache: false
+
+    - name: Get current version
+      id: current-version
+      uses: ./.github/actions/current-version
+
+    - name: Calculate new version
+      id: new-version
+      run: |
+        if [ -z "${{ github.event.inputs.version }}" ]; then
+          echo "No version provided, using next version from git-cliff"
+          version=${{ steps.current-version.outputs.next-version }}
+        elif [ "${{ github.event.inputs.version }}" = "major" ]; then
+          echo "Major version bump requested"
+          version=${{ steps.current-version.outputs.next-major-version }}
+        elif [ "${{ github.event.inputs.version }}" = "minor" ]; then
+          echo "Minor version bump requested"
+          version=${{ steps.current-version.outputs.next-minor-version }}
+        elif [ "${{ github.event.inputs.version }}" = "patch" ]; then
+          echo "Patch version bump requested"
+          version=${{ steps.current-version.outputs.next-patch-version }}
+        else
+          echo "Using specific version: ${{ github.event.inputs.version }}"
+          version=${{ github.event.inputs.version }}
+        fi
+        echo "version=$version" >> $GITHUB_OUTPUT
+
+    - name: Update version in __init__.py
+      run: |
+        echo "Updating version to ${{ steps.new-version.outputs.version }}"
+        sed -i 's/__version__ = ".*"/__version__ = "${{ steps.new-version.outputs.version }}"/' src/brag/__init__.py
+
+    - name: Update changelog with new version
+      uses: orhun/git-cliff-action@v3
+      id: update-changelog
+      with:
+        config: .github/git-cliff-config.toml
+        args: --tag v${{ steps.new-version.outputs.version }}
+      env:
+        OUTPUT: CHANGELOG.md
+
+    - name: Generate release changelog
+      uses: orhun/git-cliff-action@v3
+      id: generate-release-changelog
+      with:
+        config: .github/git-cliff-config.toml
+        args: -vv --latest
+
+    - name: Commit version and changelog
+      run: |
+        git add src/brag/__init__.py
+        git add CHANGELOG.md
+        git commit -m "chore: release v${{ steps.new-version.outputs.version }}"
+
+    - name: Push changes
+      run: |
+        git tag v${{ steps.new-version.outputs.version }}
+        git push origin main
+        git push origin v${{ steps.new-version.outputs.version }}
path: .github/workflows/release.yaml
user: login: github-advanced-security[bot]
body: steps.new-version.outputs.version may expand into attacker-controllable code

[Show more details](https://github.com/ruancomelli/brag-ai/security/code-scanning/23)
created_at: 2025-03-06T02:03:29Z
author_association: NONE
diff_hunk: @@ -0,0 +1,95 @@
+name: Release
+
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: |
+          Release version without the v prefix (e.g. 0.1.0).
+          Can also be `major`, `minor`, or `patch`.
+          If not provided, the next version will be automatically calculated.
+        required: false
+        type: string
+
+jobs:
+  release:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        fetch-depth: 0
+        persist-credentials: false
+
+    - name: Set up UV
+      uses: astral-sh/setup-uv@v5
+      with:
+        enable-cache: false
+
+    - name: Get current version
+      id: current-version
+      uses: ./.github/actions/current-version
+
+    - name: Calculate new version
+      id: new-version
+      run: |
+        if [ -z "${{ github.event.inputs.version }}" ]; then
+          echo "No version provided, using next version from git-cliff"
+          version=${{ steps.current-version.outputs.next-version }}
+        elif [ "${{ github.event.inputs.version }}" = "major" ]; then
+          echo "Major version bump requested"
+          version=${{ steps.current-version.outputs.next-major-version }}
+        elif [ "${{ github.event.inputs.version }}" = "minor" ]; then
+          echo "Minor version bump requested"
+          version=${{ steps.current-version.outputs.next-minor-version }}
+        elif [ "${{ github.event.inputs.version }}" = "patch" ]; then
+          echo "Patch version bump requested"
+          version=${{ steps.current-version.outputs.next-patch-version }}
+        else
+          echo "Using specific version: ${{ github.event.inputs.version }}"
+          version=${{ github.event.inputs.version }}
+        fi
+        echo "version=$version" >> $GITHUB_OUTPUT
+
+    - name: Update version in __init__.py
+      run: |
+        echo "Updating version to ${{ steps.new-version.outputs.version }}"
+        sed -i 's/__version__ = ".*"/__version__ = "${{ steps.new-version.outputs.version }}"/' src/brag/__init__.py
+
+    - name: Update changelog with new version
+      uses: orhun/git-cliff-action@v3
+      id: update-changelog
+      with:
+        config: .github/git-cliff-config.toml
+        args: --tag v${{ steps.new-version.outputs.version }}
+      env:
+        OUTPUT: CHANGELOG.md
+
+    - name: Generate release changelog
+      uses: orhun/git-cliff-action@v3
+      id: generate-release-changelog
+      with:
+        config: .github/git-cliff-config.toml
+        args: -vv --latest
+
+    - name: Commit version and changelog
+      run: |
+        git add src/brag/__init__.py
+        git add CHANGELOG.md
+        git commit -m "chore: release v${{ steps.new-version.outputs.version }}"
+
+    - name: Push changes
+      run: |
+        git tag v${{ steps.new-version.outputs.version }}
+        git push origin main
+        git push origin v${{ steps.new-version.outputs.version }}
path: .github/workflows/release.yaml
user: login: github-advanced-security[bot]
body: steps.new-version.outputs.version may expand into attacker-controllable code

[Show more details](https://github.com/ruancomelli/brag-ai/security/code-scanning/24)
created_at: 2025-03-06T02:03:29Z
author_association: NONE

PR comments:
user: login: sourcery-ai[bot]
created_at: 2025-03-06T02:02:55Z
body: <!-- Generated by sourcery-ai[bot]: start review_guide -->

## Reviewer's Guide by Sourcery

This pull request introduces a new workflow for releasing new versions of the project, including automated version bumping, changelog generation, and publishing to PyPI. It also separates the publish workflow from the release workflow.

_No diagrams generated as the changes look simple and do not need a visual representation._

### File-Level Changes

| Change | Details | Files |
| ------ | ------- | ----- |
| Introduces a new workflow for releasing new versions of the project, triggered manually via `workflow_dispatch`. | <ul><li>Allows specifying the release version directly or using `major`, `minor`, or `patch` to automatically calculate the next version.</li><li>Updates the version in `src/brag/__init__.py` with the new version.</li><li>Updates the changelog using `git-cliff`.</li><li>Commits the version and changelog changes.</li><li>Creates a git tag and pushes the changes to the repository.</li><li>Creates a GitHub release with the generated changelog.</li></ul> | `.github/workflows/release.yaml` |
| Adds a configuration file for `git-cliff` to manage changelog generation. | <ul><li>Configures the remote GitHub repository.</li><li>Defines templates for the changelog header, body, and footer.</li><li>Configures git commit parsing according to the conventional commits specification.</li><li>Defines commit parsers for different commit types.</li><li>Specifies tag patterns for releases.</li><li>Configures postprocessors to modify the changelog.</li></ul> | `.github/git-cliff-config.toml` |
| Creates a composite action to determine the current and next versions of the project. | <ul><li>Uses `hatch version` to get the current version.</li><li>Uses `git-cliff` to determine the next version based on commit history.</li><li>Provides outputs for the current version, next version, and next major/minor/patch versions.</li></ul> | `.github/actions/current-version/action.yaml` |
| Separates the `publish` workflow from the `release` workflow. | <ul><li>The `publish` workflow is triggered when a new release is created.</li><li>The `publish` workflow builds the package and publishes it to PyPI.</li></ul> | `.github/workflows/publish.yaml` |

---

<details>
<summary>Tips and commands</summary>

#### Interacting with Sourcery

- **Trigger a new review:** Comment `@sourcery-ai review` on the pull request.
- **Continue discussions:** Reply directly to Sourcery's review comments.
- **Generate a GitHub issue from a review comment:** Ask Sourcery to create an
  issue from a review comment by replying to it. You can also reply to a
  review comment with `@sourcery-ai issue` to create an issue from it.
- **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull
  request title to generate a title at any time. You can also comment
  `@sourcery-ai title` on the pull request to (re-)generate the title at any time.
- **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in
  the pull request body to generate a PR summary at any time exactly where you
  want it. You can also comment `@sourcery-ai summary` on the pull request to
  (re-)generate the summary at any time.
- **Generate reviewer's guide:** Comment `@sourcery-ai guide` on the pull
  request to (re-)generate the reviewer's guide at any time.
- **Resolve all Sourcery comments:** Comment `@sourcery-ai resolve` on the
  pull request to resolve all Sourcery comments. Useful if you've already
  addressed all the comments and don't want to see them anymore.
- **Dismiss all Sourcery reviews:** Comment `@sourcery-ai dismiss` on the pull
  request to dismiss all existing Sourcery reviews. Especially useful if you
  want to start fresh with a new review - don't forget to comment
  `@sourcery-ai review` to trigger a new review!
- **Generate a plan of action for an issue:** Comment `@sourcery-ai plan` on
  an issue to generate a plan of action for it.

#### Customizing Your Experience

Access your [dashboard](https://app.sourcery.ai) to:
- Enable or disable review features such as the Sourcery-generated pull request
  summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.

#### Getting Help

- [Contact our support team](mailto:support@sourcery.ai) for questions or feedback.
- Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information.
- Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).

</details>

<!-- Generated by sourcery-ai[bot]: end review_guide -->
author_association: CONTRIBUTOR
user: login: ruancomelli
created_at: 2025-03-06T02:03:06Z
body: * **#32** <a href="https://app.graphite.dev/github/pr/ruancomelli/brag-ai/32?utm_source=stack-comment-icon" target="_blank"><img src="https://static.graphite.dev/graphite-32x32-black.png" alt="Graphite" width="10px" height="10px"/></a> 👈 <a href="https://app.graphite.dev/github/pr/ruancomelli/brag-ai/32?utm_source=stack-comment-view-in-graphite" target="_blank">(View in Graphite)</a>
* `main`


<h2></h2>

This stack of pull requests is managed by <a href="https://graphite.dev?utm-source=stack-comment"><b>Graphite</b></a>. Learn more about <a href="https://stacking.dev/?utm_source=stack-comment">stacking</a>.
<!-- Current dependencies on/for this PR: -->
author_association: OWNER
user: login: codecov[bot]
created_at: 2025-03-06T02:03:45Z
body: ## [Codecov](https://app.codecov.io/gh/ruancomelli/brag-ai/pull/32?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruan+Comelli) Report
All modified and coverable lines are covered by tests :white_check_mark:

:loudspeaker: Thoughts on this report? [Let us know!](https://github.com/codecov/feedback/issues/255)
author_association: NONE