biome/scripts/print-changelog.sh
Emanuele Stoppa 7e4da4edb8
Some checks are pending
CI on main / Test (push) Waiting to run
CI on main / Format Rust Files (push) Waiting to run
CI on main / Lint Rust Files (push) Waiting to run
CI on main / Check Dependencies (push) Waiting to run
CI on main / Test262 Coverage (push) Waiting to run
Release / Release (push) Waiting to run
Release / version (push) Blocked by required conditions
Release / Package darwin-arm64 (push) Blocked by required conditions
Release / Package darwin-x64 (push) Blocked by required conditions
Release / Package linux-arm64-musl (push) Blocked by required conditions
Release / Package linux-x64-musl (push) Blocked by required conditions
Release / Package win32-arm64 (push) Blocked by required conditions
Release / Package win32-x64 (push) Blocked by required conditions
Release / Package linux-arm64 (push) Blocked by required conditions
Release / Package linux-x64 (push) Blocked by required conditions
Release / Build WASM (push) Blocked by required conditions
Release / Package JavaScript APIs (push) Blocked by required conditions
Release / Publish (push) Blocked by required conditions
Repository dispatch on main / Build @biomejs/wasm-web (push) Waiting to run
Repository dispatch on main / Repository dispatch (push) Blocked by required conditions
ci: manually push tags and create release (#6439)
2025-06-20 19:37:39 +01:00

55 lines
910 B
Bash

#!/bin/bash
# Script to extract changelog section for a specific version
# Usage: ./print-changelog.sh [version] [changelog-file]
# Default values
VERSION=""
CHANGELOG_FILE="packages/@biomejs/biome/CHANGELOG.md"
# Parse arguments
if [ $# -eq 0 ]; then
exit 1
fi
VERSION="$1"
if [ $# -eq 2 ]; then
CHANGELOG_FILE="$2"
fi
# Check if changelog file exists
if [ ! -f "$CHANGELOG_FILE" ]; then
exit 1
fi
# Extract the section for the specified version
awk -v version="$VERSION" '
BEGIN {
found = 0
printing = 0
}
# Found the version header
/^## / {
if ($2 == version) {
found = 1
printing = 1
print
next
} else if (printing) {
# Found next version section, stop printing
exit
}
}
# Print lines when we are in the target version section
printing {
print
}
END {
if (!found) {
exit 1
}
}
' "$CHANGELOG_FILE"