mirror of
https://github.com/oneclickvirt/ecs.git
synced 2025-12-24 12:37:53 +08:00
fix: 修复release的说明自动生成自动更新
This commit is contained in:
9
.github/workflows/build_binary.yaml
vendored
9
.github/workflows/build_binary.yaml
vendored
@@ -37,16 +37,21 @@ jobs:
|
||||
echo "$FULL_CHANGELOG" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create release if not exists
|
||||
- name: Create or update release
|
||||
run: |
|
||||
TAG="${{ steps.tag.outputs.tag }}"
|
||||
CHANGELOG_BODY=$(cat changelog.txt | jq -Rs .)
|
||||
RELEASE_EXISTS=$(curl -s -H "Authorization: Bearer ${{ secrets.GHT }}" "https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG" | jq -r '.id // empty')
|
||||
if [ -z "$RELEASE_EXISTS" ]; then
|
||||
CHANGELOG_BODY=$(cat changelog.txt | jq -Rs .)
|
||||
curl -s -X POST -H "Authorization: Bearer ${{ secrets.GHT }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"body\":$CHANGELOG_BODY,\"draft\":false,\"prerelease\":false}" \
|
||||
"https://api.github.com/repos/${{ github.repository }}/releases" > /dev/null
|
||||
else
|
||||
curl -s -X PATCH -H "Authorization: Bearer ${{ secrets.GHT }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"body\":$CHANGELOG_BODY}" \
|
||||
"https://api.github.com/repos/${{ github.repository }}/releases/$RELEASE_EXISTS" > /dev/null
|
||||
fi
|
||||
|
||||
- name: Delete existing release assets
|
||||
|
||||
Reference in New Issue
Block a user