diff --git a/.github/workflows/discord-release.yml b/.github/workflows/discord-release.yml new file mode 100644 index 000000000..4447c21b8 --- /dev/null +++ b/.github/workflows/discord-release.yml @@ -0,0 +1,28 @@ +name: Post Release to Discord + +on: + release: + types: [published] + +jobs: + post-release-to-discord: + runs-on: ubuntu-latest + + steps: + - name: Check if release tag starts with v4 + id: check_tag + run: | + if [[ "${{ github.event.release.tag_name }}" == v4* ]]; then + echo "Tag starts with v4" + echo "::set-output name=send_message::true" + else + echo "Tag does not start with v4" + echo "::set-output name=send_message::false" + fi + + - name: Post release to Discord + if: steps.check_tag.outputs.send_message == 'true' + run: | + curl -H "Content-Type: application/json" -d \ + "{\"content\": \"JumpServer ${{ github.event.release.tag_name }} Released! 🚀\\n${{ github.event.release.body }}\"}" \ + $DISCORD_CHANGELOG_WEBHOOK \ No newline at end of file