Skip to content

Conversation

naps62
Copy link
Member

@naps62 naps62 commented Jul 24, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings July 24, 2025 13:31
@naps62 naps62 added the C-chore tedious but necessary label Jul 24, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds Slack notification functionality to the existing GitHub Actions release workflow to notify an internal Slack channel whenever a new release is published.

  • Adds environment specification to the app job for proper release environment handling
  • Introduces a new notify-slack job that fetches release information and sends a formatted notification to Slack
  • Implements changelog truncation logic to handle long release notes within Slack message limits

Comment on lines +183 to +186
uses: 8398a7/action-slack@v3
with:
status: custom
custom_payload: |
Copy link
Preview

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The action 8398a7/action-slack@v3 is using an older version that may have security vulnerabilities. Consider updating to a more recent version or using the official Slack GitHub Action for better security and maintenance.

Suggested change
uses: 8398a7/action-slack@v3
with:
status: custom
custom_payload: |
uses: slackapi/slack-github-action@v1
with:
payload: |

Copilot uses AI. Check for mistakes.

echo "url=$release_url" >> $GITHUB_OUTPUT

# Escape changelog for JSON and truncate if too long
changelog_escaped=$(echo "$changelog" | jq -Rs . | sed 's/^"//;s/"$//')
Copy link
Preview

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog escaping logic using jq and sed is complex and error-prone. Consider using a simpler approach like 'jq -rRs .' to handle the JSON escaping, or use GitHub's built-in string escaping mechanisms.

Suggested change
changelog_escaped=$(echo "$changelog" | jq -Rs . | sed 's/^"//;s/"$//')
changelog_escaped=$(echo "$changelog" | jq -rRs .)

Copilot uses AI. Check for mistakes.

Comment on lines +174 to +176
changelog_escaped=$(echo "$changelog" | jq -Rs . | sed 's/^"//;s/"$//')
if [ ${#changelog_escaped} -gt 2000 ]; then
changelog_escaped="${changelog_escaped:0:2000}..."
Copy link
Preview

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The magic number 2000 for changelog truncation should be documented or made configurable. Consider adding a comment explaining why this specific limit was chosen (likely related to Slack message limits).

Suggested change
changelog_escaped=$(echo "$changelog" | jq -Rs . | sed 's/^"//;s/"$//')
if [ ${#changelog_escaped} -gt 2000 ]; then
changelog_escaped="${changelog_escaped:0:2000}..."
# The truncation limit is set to 2000 characters to comply with Slack's message length constraints.
TRUNCATION_LIMIT=2000
changelog_escaped=$(echo "$changelog" | jq -Rs . | sed 's/^"//;s/"$//')
if [ ${#changelog_escaped} -gt $TRUNCATION_LIMIT ]; then
changelog_escaped="${changelog_escaped:0:$TRUNCATION_LIMIT}..."

Copilot uses AI. Check for mistakes.

@naps62 naps62 merged commit 78fc9d8 into main Jul 24, 2025
7 of 8 checks passed
@naps62 naps62 deleted the slack-notify branch July 24, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-chore tedious but necessary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant