diff --git a/.github/workflows/create.release.for.tag.yml b/.github/workflows/create.release.for.tag.yml index b7b7a0a..cde4a0b 100644 --- a/.github/workflows/create.release.for.tag.yml +++ b/.github/workflows/create.release.for.tag.yml @@ -16,15 +16,51 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for all tags - name: Set current tag run: echo "CURRENT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + - name: Get previous tag + id: previoustag + run: | + # Get the latest tag that is not the current tag + PREVIOUS_TAG=$(git describe --tags --abbrev=0 $(git rev-list --tags --skip=1 --max-count=1) 2>/dev/null) + if [ $? -ne 0 ]; then + echo "No previous tag found. Using first commit." + # Use the hash of the very first commit if no previous tag is found + PREVIOUS_TAG=$(git rev-list --max-parents=0 HEAD) + fi + echo "previous_tag=$PREVIOUS_TAG" >> $GITHUB_ENV + echo "Previous tag: $PREVIOUS_TAG" + - name: Generate Release Notes env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PREVIOUS_TAG: ${{ env.previous_tag }} run: | - RELEASE_BODY="Ollama Bash Lib $CURRENT_TAG\n\nA Bash Library for Ollama\n\nRun LLM prompts straight from your shell, and more\n\nRepo: https://github.com/${{ github.repository }}\n" + RELEASE_BODY=$(cat <> $GITHUB_ENV echo -e "$RELEASE_BODY" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV diff --git a/README.md b/README.md index 29eb525..58bd68d 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,14 @@ Run LLM prompts straight from your shell, and more [▶️ Get Started in 30 seconds](#quickstart) • [💬 Join Discord][discord-invite] -![Release](https://img.shields.io/github/v/release/attogram/ollama-bash-lib?style=flat) -![License](https://img.shields.io/github/license/attogram/ollama-bash-lib?style=flat) +[![Release](https://img.shields.io/github/v/release/attogram/ollama-bash-lib?style=flat)](https://github.com/attogram/ollama-bash-lib/releases) +[![License](https://img.shields.io/github/license/attogram/ollama-bash-lib?style=flat)](./LICENSE) ![Bash ≥3.2](https://img.shields.io/badge/bash-%3E=3.2-blue?style=flat) -![GitHub commit activity](https://img.shields.io/github/commit-activity/t/attogram/ollama-bash-lib?style=flat) -![GitHub stars](https://img.shields.io/github/stars/attogram/ollama-bash-lib?style=flat) -![GitHub watchers](https://img.shields.io/github/watchers/attogram/ollama-bash-lib?style=flat) -![Forks](https://img.shields.io/github/forks/attogram/ollama-bash-lib?style=flat) -![Issues](https://img.shields.io/github/issues/attogram/ollama-bash-lib?style=flat) +[![GitHub commit activity](https://img.shields.io/github/commit-activity/t/attogram/ollama-bash-lib?style=flat)](https://github.com/attogram/ollama-bash-lib/commits/main/) +[![GitHub stars](https://img.shields.io/github/stars/attogram/ollama-bash-lib?style=flat)](https://github.com/attogram/ollama-bash-lib/stargazers) +[![GitHub watchers](https://img.shields.io/github/watchers/attogram/ollama-bash-lib?style=flat)](https://github.com/attogram/ollama-bash-lib/watchers) +[![Forks](https://img.shields.io/github/forks/attogram/ollama-bash-lib?style=flat)](https://github.com/attogram/ollama-bash-lib/forks) +[![Issues](https://img.shields.io/github/issues/attogram/ollama-bash-lib?style=flat)](https://github.com/attogram/ollama-bash-lib/issues) [Quickstart](#quickstart) - [Usage](#usage) -