Skip to content

Token completion time display, fast gen mode access, better color contrast/styling #9

Token completion time display, fast gen mode access, better color contrast/styling

Token completion time display, fast gen mode access, better color contrast/styling #9

Workflow file for this run

name: Check Version Validity
on:
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
- ready_for_review
permissions:
contents: read
jobs:
validate-version:
name: Validate changelog version is new
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout PR head
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract and validate version
id: version
shell: bash
run: |
set -euo pipefail
latest_version="$(sed -nE 's/^##[[:space:]]+\[([0-9]+\.[0-9]+\.[0-9]+)\][[:space:]]*-[[:space:]]+.*/\1/p' CHANGELOG.md | head -n 1)"
if [[ -z "${latest_version}" ]]; then
echo "::error::Changelog format invalid. Expected heading: ## [x.y.z] - YYYY-MM-DD"
exit 1
fi
echo "tag=v${latest_version}" >> "$GITHUB_OUTPUT"
echo "Detected version: ${latest_version}"
- name: Ensure version tag does not already exist
shell: bash
run: |
set -euo pipefail
git fetch --tags --force
tag="${{ steps.version.outputs.tag }}"
if git rev-parse "${tag}" >/dev/null 2>&1; then
echo "::error::Tag ${tag} already exists. Bump CHANGELOG.md to a new version before merging."
exit 1
fi