fixed benthos slack notification to trigger on pushing a tag#411
fixed benthos slack notification to trigger on pushing a tag#411prakhargarg105 wants to merge 1 commit intomainfrom
Conversation
| text: | ||
| type: "mrkdwn" | ||
| text: "${{ github.event.release.body }}" | ||
| - type: "markdown" |
There was a problem hiding this comment.
Bug: type: "markdown" is not a valid Slack Block Kit block type. The valid block types are header, section, divider, image, actions, context, input, file, and rich_text.
The original code correctly used a section block with mrkdwn text. This should be changed back to a section block with a nested text object of type: "mrkdwn", otherwise the changelog content will not render in the Slack notification (Slack silently drops unknown block types).
| echo "notes<<EOF" >> $GITHUB_OUTPUT | ||
| echo "$NOTES" >> $GITHUB_OUTPUT | ||
| echo "EOF" >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
Security: GITHUB_OUTPUT delimiter injection. Using a static EOF delimiter means that if CHANGELOG.md happens to contain a line that is exactly EOF, the output is prematurely terminated and subsequent lines are injected as arbitrary workflow output variables.
Use a random delimiter instead, e.g.:
DELIMITER=$(openssl rand -hex 16)
echo "notes<<${DELIMITER}" >> $GITHUB_OUTPUT
echo "$NOTES" >> $GITHUB_OUTPUT
echo "${DELIMITER}" >> $GITHUB_OUTPUT
|
Commits
Review
|
- Replace invalid markdown block type with section/mrkdwn - Convert markdown headers (### Foo) to Slack bold (*Foo*) - Disable link unfurling to suppress link previews
a1fbdf1 to
d0bcbcf
Compare
| text: ":github: View Tag" | ||
| emoji: true | ||
| url: "${{ github.event.release.html_url }}" | ||
| url: "${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}" |
There was a problem hiding this comment.
Bug: This URL points to /releases/tag/${{ github.ref_name }}, which is a GitHub Releases page. Since the PR description states "we don't do releases" (and the workflow was specifically changed to trigger on tag push instead of release), this URL will 404 for tags that don't have a corresponding GitHub Release.
Consider linking to the tag ref instead, e.g. /${{ github.repository }}/tree/${{ github.ref_name }} or the compare view between this tag and the previous one.
|
Commits
Review
|
fix benthos slack notification to trigger on pushing a tag since we don't do releases