mirror of
https://github.com/YACReader/yacreader
synced 2026-04-12 15:49:53 -04:00
32 lines
894 B
YAML
32 lines
894 B
YAML
name: Extract Release Notes
|
|
description: Extract release notes from CHANGELOG.md for a given version
|
|
|
|
inputs:
|
|
version:
|
|
description: Version to extract notes for
|
|
required: true
|
|
|
|
outputs:
|
|
notes:
|
|
description: Extracted release notes
|
|
value: ${{ steps.extract.outputs.notes }}
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- id: extract
|
|
shell: bash
|
|
run: |
|
|
VERSION="${{ inputs.version }}"
|
|
MAJOR="${VERSION%%.*}"
|
|
# Try exact version match first, fall back to major version match
|
|
NOTES=$(awk "/^## ${VERSION}( |$)/{found=1; next} /^## /{if(found) exit} found{print}" CHANGELOG.md)
|
|
if [ -z "$NOTES" ]; then
|
|
NOTES=$(awk "/^## ${MAJOR}( |$)/{found=1; next} /^## /{if(found) exit} found{print}" CHANGELOG.md)
|
|
fi
|
|
{
|
|
echo "notes<<EOF"
|
|
echo "$NOTES"
|
|
echo "EOF"
|
|
} >> $GITHUB_OUTPUT
|