Skip to content

Commit fb54ef9

Browse files
committed
Fix slack-notifications
1 parent 4192266 commit fb54ef9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,18 @@ jobs:
132132
uses: apache/grails-github-actions/post-release@asf
133133
notify-slack:
134134
name: Notify Slack
135-
needs: [ publish, release ] # adjust depending on your job names
135+
needs: [ publish, release ]
136136
if: ${{ success() }}
137137
runs-on: ubuntu-latest
138138
steps:
139+
- name: Prepare release body
140+
id: body
141+
run: |
142+
if [ -n "${{ github.event.release.body }}" ]; then
143+
echo "body=${{ github.event.release.body }}" >> $GITHUB_OUTPUT
144+
else
145+
echo "body=No release notes provided." >> $GITHUB_OUTPUT
146+
fi
139147
- name: Send Slack message
140148
uses: slackapi/slack-github-action@v1.27.0
141149
with:
@@ -147,7 +155,9 @@ jobs:
147155
"color": "#36a64f",
148156
"title": "${{ github.event.release.name }}",
149157
"title_link": "${{ github.event.release.html_url }}",
150-
"text": "${{ github.event.release.body }}"
158+
"text": ${{
159+
toJson(steps.body.outputs.body)
160+
}}
151161
}
152162
]
153163
}

0 commit comments

Comments
 (0)