dev: stable version #1
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: Notify | ||
|
Check failure on line 1 in .github/workflows/notify.yml
|
||
| on: | ||
| release: | ||
| types: [published] | ||
| issues: | ||
| types: [opened, closed] | ||
| pull_request: | ||
| types: [opened, closed, merged] | ||
| jobs: | ||
| notify-release: | ||
| if: github.event_name == 'release' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Notify Discord | ||
| uses: sarisia/actions-status-discord@v1 | ||
| if: env.DISCORD_WEBHOOK | ||
| env: | ||
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
| with: | ||
| webhook: ${{ secrets.DISCORD_WEBHOOK }} | ||
| status: success | ||
| title: "🎉 New Release: ${{ github.event.release.name }}" | ||
| description: | | ||
| A new version of YouTube Shorts Blocker has been released! | ||
| **Version:** ${{ github.event.release.tag_name }} | ||
| **Release Notes:** ${{ github.event.release.body }} | ||
| Download: ${{ github.event.release.html_url }} | ||
| notify-issue: | ||
| if: github.event_name == 'issues' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Notify on new issue | ||
| if: github.event.action == 'opened' | ||
| uses: sarisia/actions-status-discord@v1 | ||
| if: env.DISCORD_WEBHOOK | ||
| env: | ||
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
| with: | ||
| webhook: ${{ secrets.DISCORD_WEBHOOK }} | ||
| status: info | ||
| title: "🐛 New Issue: ${{ github.event.issue.title }}" | ||
| description: | | ||
| A new issue has been opened. | ||
| **Issue:** #${{ github.event.issue.number }} | ||
| **Author:** ${{ github.event.issue.user.login }} | ||
| **Labels:** ${{ join(github.event.issue.labels.*.name, ', ') }} | ||
| View: ${{ github.event.issue.html_url }} | ||
| - name: Notify on issue closed | ||
| if: github.event.action == 'closed' | ||
| uses: sarisia/actions-status-discord@v1 | ||
| if: env.DISCORD_WEBHOOK | ||
| env: | ||
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
| with: | ||
| webhook: ${{ secrets.DISCORD_WEBHOOK }} | ||
| status: success | ||
| title: "✅ Issue Closed: ${{ github.event.issue.title }}" | ||
| description: | | ||
| An issue has been closed. | ||
| **Issue:** #${{ github.event.issue.number }} | ||
| **Closed by:** ${{ github.event.issue.closed_by.login }} | ||
| View: ${{ github.event.issue.html_url }} | ||
| notify-pr: | ||
| if: github.event_name == 'pull_request' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Notify on new PR | ||
| if: github.event.action == 'opened' | ||
| uses: sarisia/actions-status-discord@v1 | ||
| if: env.DISCORD_WEBHOOK | ||
| env: | ||
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
| with: | ||
| webhook: ${{ secrets.DISCORD_WEBHOOK }} | ||
| status: info | ||
| title: "🔀 New Pull Request: ${{ github.event.pull_request.title }}" | ||
| description: | | ||
| A new pull request has been opened. | ||
| **PR:** #${{ github.event.pull_request.number }} | ||
| **Author:** ${{ github.event.pull_request.user.login }} | ||
| **Branch:** ${{ github.event.pull_request.head.ref }} → ${{ github.event.pull_request.base.ref }} | ||
| View: ${{ github.event.pull_request.html_url }} | ||
| - name: Notify on PR merged | ||
| if: github.event.action == 'closed' && github.event.pull_request.merged | ||
| uses: sarisia/actions-status-discord@v1 | ||
| if: env.DISCORD_WEBHOOK | ||
| env: | ||
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
| with: | ||
| webhook: ${{ secrets.DISCORD_WEBHOOK }} | ||
| status: success | ||
| title: "✅ Pull Request Merged: ${{ github.event.pull_request.title }}" | ||
| description: | | ||
| A pull request has been merged. | ||
| **PR:** #${{ github.event.pull_request.number }} | ||
| **Author:** ${{ github.event.pull_request.user.login }} | ||
| **Merged by:** ${{ github.event.pull_request.merged_by.login }} | ||
| View: ${{ github.event.pull_request.html_url }} | ||
| notify-email: | ||
| if: github.event_name == 'release' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Send email notification | ||
| uses: dawidd6/action-send-mail@v3 | ||
| if: env.MAIL_HOST | ||
| with: | ||
| server_address: ${{ secrets.MAIL_HOST }} | ||
| server_port: ${{ secrets.MAIL_PORT }} | ||
| username: ${{ secrets.MAIL_USERNAME }} | ||
| password: ${{ secrets.MAIL_PASSWORD }} | ||
| subject: "🎉 New Release: ${{ github.event.release.name }}" | ||
| to: ${{ secrets.MAIL_TO }} | ||
| from: ${{ secrets.MAIL_FROM }} | ||
| body: | | ||
| Hello! | ||
| A new version of YouTube Shorts Blocker has been released. | ||
| **Version:** ${{ github.event.release.tag_name }} | ||
| **Release Notes:** ${{ github.event.release.body }} | ||
| Download: ${{ github.event.release.html_url }} | ||
| Best regards, | ||
| YouTube Shorts Blocker Team | ||