|
7 | 7 | description: 'Version tag (e.g., v0.1.1)' |
8 | 8 | required: true |
9 | 9 | type: string |
| 10 | + description: |
| 11 | + description: 'Release description (optional - provide context about this release)' |
| 12 | + required: false |
| 13 | + type: string |
10 | 14 |
|
11 | 15 | env: |
12 | 16 | GO_VERSION: '1.25' |
@@ -105,47 +109,43 @@ jobs: |
105 | 109 | - name: Generate release notes |
106 | 110 | id: release_notes |
107 | 111 | run: | |
| 112 | + # Get repository name from GitHub context |
| 113 | + REPO_NAME="${{ github.event.repository.name }}" |
| 114 | + REPO_URL="https://github.com/${{ github.repository }}" |
| 115 | +
|
108 | 116 | # Get the previous tag |
109 | 117 | PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "") |
110 | 118 |
|
111 | | - if [ -z "$PREV_TAG" ]; then |
112 | | - # First release |
113 | | - echo "notes<<EOF" >> $GITHUB_OUTPUT |
114 | | - echo "## DotErr ${{ inputs.version }}" >> $GITHUB_OUTPUT |
| 119 | + echo "notes<<EOF" >> $GITHUB_OUTPUT |
| 120 | + echo "## ${REPO_NAME} ${{ inputs.version }}" >> $GITHUB_OUTPUT |
| 121 | + echo "" >> $GITHUB_OUTPUT |
| 122 | +
|
| 123 | + # Add user-provided description if present |
| 124 | + if [ -n "${{ inputs.description }}" ]; then |
| 125 | + echo "${{ inputs.description }}" >> $GITHUB_OUTPUT |
115 | 126 | echo "" >> $GITHUB_OUTPUT |
116 | | - echo "Initial release of go-doterr - embeddable, zero-dependency error composition for Go." >> $GITHUB_OUTPUT |
| 127 | + fi |
| 128 | +
|
| 129 | + if [ -z "$PREV_TAG" ]; then |
| 130 | + # First release - show all commits from beginning |
| 131 | + echo "### Commits" >> $GITHUB_OUTPUT |
117 | 132 | echo "" >> $GITHUB_OUTPUT |
118 | | - echo "### Features" >> $GITHUB_OUTPUT |
119 | | - echo "- Structured error metadata with key-value pairs" >> $GITHUB_OUTPUT |
120 | | - echo "- Sentinel error support for type-safe error identification" >> $GITHUB_OUTPUT |
121 | | - echo "- Layered error composition with cause chains" >> $GITHUB_OUTPUT |
122 | | - echo "- Error enrichment with \`WithErr()\` for same-function metadata" >> $GITHUB_OUTPUT |
123 | | - echo "- Multi-error bundling with \`CombineErrs()\`" >> $GITHUB_OUTPUT |
124 | | - echo "- Zero external dependencies - pure Go stdlib" >> $GITHUB_OUTPUT |
125 | | - echo "- Three usage patterns: embed source file, dot-import, or normal import" >> $GITHUB_OUTPUT |
126 | | - echo "- Cross-package error detection for embedded instances" >> $GITHUB_OUTPUT |
| 133 | + git log --pretty=format:"- [**%h**](${REPO_URL}/commit/%H) - %s (%an, %ar)" >> $GITHUB_OUTPUT |
127 | 134 | echo "" >> $GITHUB_OUTPUT |
128 | | - echo "### Usage Patterns" >> $GITHUB_OUTPUT |
129 | | - echo "1. **Embed the source file** (recommended) - copy \`doterr.go\` directly into your package" >> $GITHUB_OUTPUT |
130 | | - echo "2. **Dot-import** - \`import . \"github.com/mikeschinkel/go-doterr\"\`" >> $GITHUB_OUTPUT |
131 | | - echo "3. **Normal import** - \`import \"github.com/mikeschinkel/go-doterr\"\`" >> $GITHUB_OUTPUT |
132 | 135 | echo "" >> $GITHUB_OUTPUT |
133 | | - echo "See [README.md](README.md) for full documentation and examples." >> $GITHUB_OUTPUT |
134 | | - echo "EOF" >> $GITHUB_OUTPUT |
| 136 | + echo "See [README.md](README.md) for documentation and usage." >> $GITHUB_OUTPUT |
135 | 137 | else |
136 | | - # Subsequent releases - generate from commits |
137 | | - echo "notes<<EOF" >> $GITHUB_OUTPUT |
138 | | - echo "## DotErr ${{ inputs.version }}" >> $GITHUB_OUTPUT |
139 | | - echo "" >> $GITHUB_OUTPUT |
| 138 | + # Subsequent releases - show commits since last tag |
140 | 139 | echo "### Changes since $PREV_TAG" >> $GITHUB_OUTPUT |
141 | 140 | echo "" >> $GITHUB_OUTPUT |
142 | | - git log ${PREV_TAG}..HEAD --pretty=format:"- %s" >> $GITHUB_OUTPUT |
| 141 | + git log ${PREV_TAG}..HEAD --pretty=format:"- [**%h**](${REPO_URL}/commit/%H) - %s (%an, %ar)" >> $GITHUB_OUTPUT |
143 | 142 | echo "" >> $GITHUB_OUTPUT |
144 | 143 | echo "" >> $GITHUB_OUTPUT |
145 | | - echo "**Full Changelog**: https://github.com/mikeschinkel/go-doterr/compare/${PREV_TAG}...${{ inputs.version }}" >> $GITHUB_OUTPUT |
146 | | - echo "EOF" >> $GITHUB_OUTPUT |
| 144 | + echo "**Full Changelog**: ${REPO_URL}/compare/${PREV_TAG}...${{ inputs.version }}" >> $GITHUB_OUTPUT |
147 | 145 | fi |
148 | 146 |
|
| 147 | + echo "EOF" >> $GITHUB_OUTPUT |
| 148 | +
|
149 | 149 | - name: Create GitHub Release |
150 | 150 | uses: softprops/action-gh-release@v2 |
151 | 151 | with: |
|
0 commit comments