mirror of
https://github.com/prompt-security/clawsec.git
synced 2026-06-13 05:28:02 +03:00
feat: enhance skill release workflow with changelog extraction for versioned releases
This commit is contained in:
@@ -3,8 +3,8 @@ name: Deploy to GitHub Pages
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["CI", "Skill Release"]
|
||||
branches: [main]
|
||||
types: [completed]
|
||||
# Note: No branch restriction - must trigger on both main branch CI runs AND tag-based Skill Releases
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
|
||||
@@ -787,6 +787,41 @@ jobs:
|
||||
echo "Signed and verified release-assets/checksums.json"
|
||||
ls -la release-assets/
|
||||
|
||||
- name: Extract changelog entry
|
||||
id: changelog
|
||||
run: |
|
||||
set -euo pipefail
|
||||
SKILL_PATH="${{ steps.parse.outputs.skill_path }}"
|
||||
VERSION="${{ steps.parse.outputs.version }}"
|
||||
|
||||
if [ ! -f "$SKILL_PATH/CHANGELOG.md" ]; then
|
||||
echo "No CHANGELOG.md found"
|
||||
echo "changelog=" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Extract the changelog section for this version
|
||||
# Pattern: ## [VERSION] - DATE ... until next ## [ or end of file
|
||||
CHANGELOG_ENTRY=$(awk -v version="$VERSION" '
|
||||
BEGIN { in_section = 0; found = 0 }
|
||||
$0 ~ ("^## \\[" version "\\]") { in_section = 1; found = 1; next }
|
||||
in_section && /^## \[/ && found { exit }
|
||||
in_section { print }
|
||||
' "$SKILL_PATH/CHANGELOG.md")
|
||||
|
||||
if [ -z "$CHANGELOG_ENTRY" ]; then
|
||||
echo "No changelog entry found for version $VERSION"
|
||||
echo "changelog=" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "Found changelog entry for version $VERSION"
|
||||
# Use multiline output format for GitHub Actions
|
||||
{
|
||||
echo "changelog<<EOF"
|
||||
echo "$CHANGELOG_ENTRY"
|
||||
echo "EOF"
|
||||
} >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
|
||||
with:
|
||||
@@ -796,6 +831,8 @@ jobs:
|
||||
body: |
|
||||
## ${{ steps.parse.outputs.skill_name }} ${{ steps.parse.outputs.version }}
|
||||
|
||||
${{ steps.changelog.outputs.changelog }}
|
||||
|
||||
### Quick Install
|
||||
|
||||
**Via clawhub (recommended):**
|
||||
|
||||
Reference in New Issue
Block a user