git-bot-feedback 0.5.3

A library designed for CI tools that posts comments on a Pull Request.
Documentation
name: Bump-n-Release

# NOTE: The change log is only updated in the remote upon release (in `bump-release` job)

on:
  push:
    branches:
      - "main"
  pull_request:
    branches:
      - "main"
  workflow_dispatch:
    inputs:
      component:
        description: The version component to increase
        type: choice
        required: true
        default: patch
        options:
          - major
          - minor
          - patch
          - rc

permissions: {}

jobs:
  bump-release:
    if: github.event_name == 'workflow_dispatch'
    environment:
      name: stage-deployment
    runs-on: ubuntu-latest
    # permissions needed by the BUMP_N_RELEASE token:
    # permissions:
    #   contents: write
    #   pull-requests: read
    # BUMP_N_RELEASE (PAT) token needed to trigger other CI
    # permissions used by the `github.token` (which cannot trigger other CI):
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@v6
        with:
          token: ${{ secrets.BUMP_N_RELEASE }}
          fetch-depth: 0
          fetch-tags: true
          persist-credentials: true # needed to git push changes

      - name: Setup nushell
        uses: hustcer/setup-nu@92c296ba1ba2ba04cc948ab64ddefe192dc13f0c # v3.23
        with:
          version: "*"

      - uses: cargo-bins/cargo-binstall@0b24824336e2b3800b0f89d9e08b2c08bfa3dcdd # v1.17.9
      - name: Install git-cliff
        run: cargo binstall -y git-cliff
        env:
          GITHUB_TOKEN: ${{ github.token }}
      - name: Install cargo-edit
        run: >-
          cargo install
          --no-default-features
          --features set-version
          --bin cargo-set-version
          cargo-edit

      - name: Bump ${{ inputs.component }} version
        env:
          GITHUB_TOKEN: ${{ secrets.BUMP_N_RELEASE }}
        run: nu .github/workflows/bump-n-release.nu ${{ inputs.component }}

  unreleased-changes:
    if: github.event_name != 'workflow_dispatch'
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: read
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0
          fetch-tags: true
          persist-credentials: false
      - uses: actions/setup-python@v6
        id: python-setup
        with:
          python-version: "3.x"
      - name: Install uv
        uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
        with:
          enable-cache: false
      - name: Generate a changelog
        env:
          GIT_CLIFF_CONFIG: .config/cliff.toml
          GITHUB_REPO: ${{ github.repository }}
          GITHUB_TOKEN: ${{ github.token }}
        run: >-
          uvx --constraints .github/requirements.txt
          git-cliff --unreleased --output "${GITHUB_STEP_SUMMARY}"