diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index 6db05d57c..41437c6b2 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -32,8 +32,7 @@ jobs: TargetVersion="" if [ "${{ github.event.release.tag_name }}" ] ; then TargetVersion=${{ github.event.release.tag_name }} - fi - then + else TargetVersion=$(echo "$GITHUB_REF" | sed 's/refs\/tags\///') fi echo "TargetVersion: $TargetVersion" diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 2c61c1ee5..a8fef3334 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -32,15 +32,17 @@ jobs: - name: Extract Release Notes id: release_notes run: | - content=$(grep -m1 "##" -A 1000 ./CHANGELOG.md) - echo "::set-output name=content::$content" + content=$(grep -m1 "##" -A 1000 ./CHANGELOG.md) + version=$(echo "$GITHUB_REF" | sed 's/refs\/tags\///') + echo "::set-output name=content::$content" + echo "::set-output name=version::$version" - name: Create Release uses: softprops/action-gh-release@v1 with: files: './src/Ray.BiliBiliTool.Console/bin/Publish/*.zip' token: ${{ secrets.GITHUB_TOKEN }} - name: "BiliBiliToolPro-V${{ github.event.inputs.version }}" + name: "BiliBiliToolPro-V${{ steps.release_notes.outputs.version }}" tag_name: ${{ github.event.inputs.version }} body: ${{ steps.release_notes.outputs.content }} discussion_category_name: Announcements