@@ -98,19 +98,36 @@ jobs:
9898 - Use @since ${{ steps.version.outputs.next_version }} ONLY on symbols that are demonstrably new in this commit's diff
9999 - If a symbol was in the file before this commit, omit @since
100100
101- - name : Build PR body
102- id : pr-body
101+ - name : Build PR metadata
102+ id : pr-meta
103103 if : steps.changed-files.outputs.has_files == 'true'
104104 run : |
105105 SHORT_SHA="${{ github.sha }}"
106106 SHORT_SHA="${SHORT_SHA:0:7}"
107107 COMMIT_URL="${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}"
108+ COMMIT_SUBJECT=$(git log --format="%s" -1 ${{ github.sha }})
109+
110+ # Build a concise title from the commit subject (strip conventional commit prefix if present)
111+ CLEAN_SUBJECT=$(echo "$COMMIT_SUBJECT" | sed 's/^[a-z]*([^)]*): //' | sed 's/^[a-z]*: //')
112+ # Truncate to 60 chars to leave room for the prefix
113+ CLEAN_SUBJECT=$(echo "$CLEAN_SUBJECT" | cut -c1-60)
114+ PR_TITLE="docs: add TSDocs for \"${CLEAN_SUBJECT}\""
115+
116+ echo "pr_title=${PR_TITLE}" >> "$GITHUB_OUTPUT"
117+
108118 {
109119 echo 'BODY<<PR_BODY_EOF'
110120 echo "## Automated TSDoc Additions"
111121 echo ""
112122 echo "This PR adds TSDoc comments to TypeScript source files changed in commit [\`${SHORT_SHA}\`](${COMMIT_URL})."
113123 echo ""
124+ echo "**Triggered by:** ${COMMIT_SUBJECT}"
125+ echo ""
126+ echo "**Files updated:**"
127+ echo "${{ steps.changed-files.outputs.files }}" | while IFS= read -r f; do
128+ [ -n "$f" ] && echo "- \`$f\`"
129+ done
130+ echo ""
114131 echo "> Review carefully before merging. Claude may have missed context or used incorrect descriptions."
115132 printf '\n'
116133 echo 'PR_BODY_EOF'
@@ -125,7 +142,7 @@ jobs:
125142 base : develop
126143 branch : docs/add-tsdocs
127144 branch-suffix : timestamp
128- title : " docs: add TSDocs for ${{ github.sha }}"
145+ title : ${{ steps.pr-meta.outputs.pr_title }}
129146 labels : " type: chore"
130147 add-paths : packages/**
131- body : ${{ steps.pr-body .outputs.BODY }}
148+ body : ${{ steps.pr-meta .outputs.BODY }}
0 commit comments