Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/release-notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,24 @@ on:
jobs:
notify:
runs-on: ubuntu-latest
if: ${{ secrets.SLACK_WEBHOOK_URL != '' }}
steps:
- name: Build Slack message
- name: Build Slack payload
id: message
if: ${{ env.SLACK_WEBHOOK_URL != '' }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
TAG: ${{ github.event.release.tag_name }}
RELEASE_NAME: ${{ github.event.release.name }}
URL: ${{ github.event.release.html_url }}
run: |
echo "text=🚀 *Visitran ${TAG}* released! ${RELEASE_NAME} <${URL}|View Release Notes>" >> "$GITHUB_OUTPUT"
TEXT=$(printf '🚀 *Visitran %s* released! %s <%s|View Release Notes>' "$TAG" "$RELEASE_NAME" "$URL")
PAYLOAD=$(jq -nc --arg text "$TEXT" '{"text": $text}')
echo "payload=$PAYLOAD" >> "$GITHUB_OUTPUT"

- name: Post to Slack
if: ${{ steps.message.outputs.payload != '' }}
uses: slackapi/slack-github-action@v2.1.0
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
{
"text": "${{ steps.message.outputs.text }}"
}
payload: ${{ steps.message.outputs.payload }}
Loading