Add slack notification upon release published #4
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: Slack notification for new theme release | |
| on: | |
| pull_request: | |
| # repository_dispatch: | |
| # types: [trigger-slack-notification] | |
| permissions: | |
| contents: read | |
| jobs: | |
| release-notification: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| actions: read # for 8398a7/action-slack | |
| checks: read | |
| steps: | |
| - name: Send notification | |
| uses: 8398a7/action-slack@1750b5085f3ec60384090fb7c52965ef822e869e # v3.18.0 | |
| with: | |
| status: custom | |
| custom_payload: | | |
| { | |
| username: 'Github', | |
| mention: 'channel', | |
| attachments: [{ | |
| title: `New theme release - SOME RELEASE NAME`, | |
| color: '#009223', | |
| fields: [{ | |
| title: 'Preview', | |
| value: `SOME PREVIEW LINK`, | |
| short: false | |
| }, | |
| { | |
| title: 'Tag', | |
| value: `SOME RELEASE TAG NAME`, | |
| short: true | |
| }, | |
| { | |
| title: 'Author', | |
| value: `SOME RELEASE AUTHOR`, | |
| short: true | |
| }, | |
| { | |
| title: 'Preview URL', | |
| value: `SOME PREVIEW URL`, | |
| short: true | |
| }] | |
| }] | |
| } | |
| env: | |
| SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |