github.com/instana/go-sensor@v1.62.2-0.20240520081010-4919868049e1/.github/workflows/slack_notification.yml (about) 1 name: Slack Post 2 run-name: Posting the release in ${{ github.event.release.name }} to slack 3 on: 4 release: 5 types: [published] 6 jobs: 7 publish-release: 8 runs-on: ubuntu-latest 9 steps: 10 - uses: actions/checkout@v2 11 - name: Set env 12 run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV 13 14 - name: Send success message to slack release channel 15 if: "${{ success() && env.DRY_RUN != 'true' }}" 16 uses: slackapi/slack-github-action@v1.24.0 17 with: 18 channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }} 19 payload: | 20 { 21 "text": ":mega: *Go Tracer team* : Go package ${{ github.event.release.name }} has been released", 22 "blocks": [ 23 { 24 "type": "section", 25 "text": { 26 "type": "mrkdwn", 27 "text": ":mega: *Go Tracer team* : Go package ${{ github.event.release.name }} has been released. :tada:" 28 } 29 }, 30 { 31 "type": "section", 32 "text": { 33 "type": "mrkdwn", 34 "text": ${{ toJSON(github.event.release.body) }} 35 } 36 }, 37 { 38 "type": "section", 39 "text": { 40 "type": "mrkdwn", 41 "text": "Release link: <${{ github.event.release.html_url }}|${{ github.event.release.html_url }}>" 42 } 43 } 44 ] 45 } 46 env: 47 SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} 48 SLACK_RELEASE_CHANNEL_ID: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }} 49