fix: use environment variable to pass full tag message to GoReleaser
- Extract complete tag message body in workflow using git format - Pass tag message via TAG_MESSAGE environment variable - Update goreleaser config to use .Env.TAG_MESSAGE instead of .TagBody - Fix release notes being truncated to first paragraph only
This commit is contained in:
11
.github/workflows/release.yml
vendored
11
.github/workflows/release.yml
vendored
@@ -85,6 +85,16 @@ jobs:
|
|||||||
go-version: '1.24'
|
go-version: '1.24'
|
||||||
cache-dependency-path: backend/go.sum
|
cache-dependency-path: backend/go.sum
|
||||||
|
|
||||||
|
- name: Get tag message
|
||||||
|
id: tag_message
|
||||||
|
run: |
|
||||||
|
# 获取完整的 tag message(跳过第一行标题)
|
||||||
|
TAG_MESSAGE=$(git tag -l --format='%(contents:body)' ${GITHUB_REF#refs/tags/})
|
||||||
|
# 使用 EOF 分隔符处理多行内容
|
||||||
|
echo "message<<EOF" >> $GITHUB_OUTPUT
|
||||||
|
echo "$TAG_MESSAGE" >> $GITHUB_OUTPUT
|
||||||
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Run GoReleaser
|
- name: Run GoReleaser
|
||||||
uses: goreleaser/goreleaser-action@v6
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
@@ -92,6 +102,7 @@ jobs:
|
|||||||
args: release --clean --skip=validate
|
args: release --clean --skip=validate
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
TAG_MESSAGE: ${{ steps.tag_message.outputs.message }}
|
||||||
|
|
||||||
# ===========================================================================
|
# ===========================================================================
|
||||||
# Docker Build and Push
|
# Docker Build and Push
|
||||||
|
|||||||
@@ -56,14 +56,12 @@ release:
|
|||||||
name: sub2api
|
name: sub2api
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: auto
|
prerelease: auto
|
||||||
name_template: "v{{.Version}}"
|
name_template: "Sub2API {{.Version}}"
|
||||||
# 完全使用 tag 消息作为 release 内容
|
# 完全使用 tag 消息作为 release 内容(通过环境变量传入)
|
||||||
header: |
|
header: |
|
||||||
## Sub2API {{.Version}}
|
|
||||||
|
|
||||||
> AI API Gateway Platform - 将 AI 订阅配额分发和管理
|
> AI API Gateway Platform - 将 AI 订阅配额分发和管理
|
||||||
|
|
||||||
{{ .TagBody }}
|
{{ .Env.TAG_MESSAGE }}
|
||||||
|
|
||||||
footer: |
|
footer: |
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user