Add video/image preview with clip editor for all formats #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Discord Notifications | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ["v*"] | |
| jobs: | |
| notify: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Push Notification | |
| if: github.ref == 'refs/heads/main' | |
| env: | |
| WEBHOOK_URL: ${{ secrets.PRIVAT_DC_NOTIFY }} | |
| COMMIT_MSG: ${{ github.event.head_commit.message }} | |
| run: | | |
| FIRST_LINE=$(echo "$COMMIT_MSG" | head -1) | |
| SHORT_SHA="${GITHUB_SHA:0:7}" | |
| REPO="${{ github.repository }}" | |
| ACTOR="${{ github.actor }}" | |
| TIMESTAMP=$(date -u +"%d.%m.%Y %H:%M") | |
| COMMIT_URL="https://github.com/${REPO}/commit/${GITHUB_SHA}" | |
| DESC="[\`${SHORT_SHA}\`](${COMMIT_URL}) ${FIRST_LINE}" | |
| PAYLOAD=$(jq -n \ | |
| --arg author "$ACTOR" \ | |
| --arg desc "$DESC" \ | |
| --arg footer "${REPO} • ${TIMESTAMP}" \ | |
| '{embeds: [{color: 5793266, author: {name: $author}, title: "Push to main", description: $desc, footer: {text: $footer}}]}') | |
| curl -s -H "Content-Type: application/json" -X POST "$WEBHOOK_URL" -d "$PAYLOAD" | |
| - name: Release Notification | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| env: | |
| WEBHOOK_URL: ${{ secrets.PRIVAT_DC_NOTIFY }} | |
| run: | | |
| TAG="${GITHUB_REF#refs/tags/}" | |
| REPO="${{ github.repository }}" | |
| ACTOR="${{ github.actor }}" | |
| TIMESTAMP=$(date -u +"%d.%m.%Y %H:%M") | |
| RELEASE_URL="https://github.com/${REPO}/releases/tag/${TAG}" | |
| DESC="${TAG} is now available.\n\n[Download from GitHub](${RELEASE_URL})" | |
| PAYLOAD=$(jq -n \ | |
| --arg author "$ACTOR" \ | |
| --arg title "Release: ConvertX ${TAG}" \ | |
| --arg desc "$DESC" \ | |
| --arg footer "${REPO} • ${TIMESTAMP}" \ | |
| '{embeds: [{color: 5025616, author: {name: $author}, title: $title, description: $desc, footer: {text: $footer}}]}') | |
| curl -s -H "Content-Type: application/json" -X POST "$WEBHOOK_URL" -d "$PAYLOAD" |