From 02ad10d2859979a9e3a03d44f460c69324598301 Mon Sep 17 00:00:00 2001 From: violetc <58360096+s-yh-china@users.noreply.github.com> Date: Tue, 29 Nov 2022 19:18:32 +0800 Subject: [PATCH] Update CI --- .github/workflows/leaves.yml | 20 ++++++++++++++++---- scripts/GetReleaseInfo.sh | 2 ++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/leaves.yml b/.github/workflows/leaves.yml index d7514e32..4dd57817 100644 --- a/.github/workflows/leaves.yml +++ b/.github/workflows/leaves.yml @@ -56,8 +56,20 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Github Releases To Discord - uses: SethCohen/github-releases-to-discord@v1.13.0 + uses: LeGitHubDeTai/github-to-discord@main with: - webhook_url: ${{ secrets.DISCORD_WEBHOOK }} - username: "Leaves CI" - avatar_url: "https://avatars.githubusercontent.com/u/93428079" + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + DISCORD_USERNAME: "Leaves CI" + DISCORD_AVATAR: "https://avatars.githubusercontent.com/u/93428079" + MESSAGE_TITLE: ${{ env.name }} + MESSAGE_DESCRIPTION: "Leaves CI Action" + MESSAGE_URL: ${{ env.url }} + CONTENT: ${{ env.changelog }} + MESSAGE_COLOR: 5814783 + SECTION_NAME: "ChangeLog" + AUTHOR_NAME: "LeavesMC" + AUTHOR_URL: null + AUTHOR_AVATAR: null + FOOTER_TEXT: null + FOOTER_URL: null + IMAGE: null diff --git a/scripts/GetReleaseInfo.sh b/scripts/GetReleaseInfo.sh index aa2c3e9a..65e529e3 100644 --- a/scripts/GetReleaseInfo.sh +++ b/scripts/GetReleaseInfo.sh @@ -24,6 +24,7 @@ echo "name=Leaves-$commitid" >> $GITHUB_ENV echo "tag=$tagid" >> $GITHUB_ENV echo "jar=$jarName" >> $GITHUB_ENV echo "info=$releaseinfo" >> $GITHUB_ENV +echo "url=https://github.com/LeavesMC/Leaves/releases/tag/$tagid" >> $GITHUB_ENV echo "Leaves-$commitid [![download](https://img.shields.io/github/downloads/LeavesMC/Leaves/$tagid/total?color=0)](https://github.com/Leaves/LeavesMC/releases/download/$tagid/$jarName)" >> $releaseinfo echo "=====" >> $releaseinfo @@ -32,6 +33,7 @@ echo "### Commit Message" >> $releaseinfo number=$(git log --oneline master ^`git describe --tags --abbrev=0` | wc -l) echo "$(git log --pretty='> [%h] %s' -$number)" >> $releaseinfo +echo "changelog=$(git log --pretty='> [%h] %s' -$number)" >> $GITHUB_ENV echo "" >> $releaseinfo echo "### Checksum" >> $releaseinfo