Skip to content

Disable Discord notifications for pre-release versions#1132

Merged
roflmuffin merged 2 commits intomainfrom
copilot/disable-notifications-prerelease
Dec 3, 2025
Merged

Disable Discord notifications for pre-release versions#1132
roflmuffin merged 2 commits intomainfrom
copilot/disable-notifications-prerelease

Conversation

Copy link
Contributor

Copilot AI commented Dec 3, 2025

Discord notifications were being sent for all releases including pre-releases (alpha, beta, rc). This adds a conditional to skip notifications for pre-release tags.

Changes

  • Added if condition to the "Send Notification to Discord" step in build-and-publish.yml
if: ${{ !contains(github.ref_name, '-alpha') && !contains(github.ref_name, '-beta') && !contains(github.ref_name, '-rc') }}

Tags like v2.0.0 will send notifications; tags like v2.0.0-alpha.1, v2.0.0-beta.1, v2.0.0-rc.1 will not.

Original prompt

Problem

Currently, the build-and-publish.yml workflow sends Discord notifications for all releases, including pre-release versions (alpha, beta, rc). We want to disable Discord notifications specifically for pre-release versions while keeping them enabled for stable releases.

Required Changes

Modify the .github/workflows/build-and-publish.yml file to conditionally send Discord notifications only for stable releases.

Implementation Details

  1. Add a condition to the Discord notification step (currently at line 260-270)
  2. The condition should check if the tag contains pre-release identifiers like -alpha, -beta, -rc, etc.
  3. Only send the Discord notification if it's NOT a pre-release version

Suggested Approach

Add an if condition to the "Send Notification to Discord" step that checks if the tag does not contain pre-release identifiers. You can use GitHub's expression syntax to check if the tag contains these keywords.

Example condition pattern:

if: ${{ !contains(github.ref_name, '-alpha') && !contains(github.ref_name, '-beta') && !contains(github.ref_name, '-rc') }}

This ensures that tags like v2.0.0-alpha.1, v2.0.0-beta.1, or v2.0.0-rc.1 will not trigger Discord notifications, but v2.0.0 will.

File to Modify

  • .github/workflows/build-and-publish.yml - Add the condition to the "Send Notification to Discord" step (around line 260)

Testing Considerations

  • Stable release tags (e.g., v2.0.0) should still send Discord notifications
  • Pre-release tags (e.g., v2.0.0-alpha.1, v2.0.0-beta.1, v2.0.0-rc.1) should NOT send Discord notifications
  • All other workflow functionality should remain unchanged

This pull request was created as a result of the following prompt from Copilot chat.

Problem

Currently, the build-and-publish.yml workflow sends Discord notifications for all releases, including pre-release versions (alpha, beta, rc). We want to disable Discord notifications specifically for pre-release versions while keeping them enabled for stable releases.

Required Changes

Modify the .github/workflows/build-and-publish.yml file to conditionally send Discord notifications only for stable releases.

Implementation Details

  1. Add a condition to the Discord notification step (currently at line 260-270)
  2. The condition should check if the tag contains pre-release identifiers like -alpha, -beta, -rc, etc.
  3. Only send the Discord notification if it's NOT a pre-release version

Suggested Approach

Add an if condition to the "Send Notification to Discord" step that checks if the tag does not contain pre-release identifiers. You can use GitHub's expression syntax to check if the tag contains these keywords.

Example condition pattern:

if: ${{ !contains(github.ref_name, '-alpha') && !contains(github.ref_name, '-beta') && !contains(github.ref_name, '-rc') }}

This ensures that tags like v2.0.0-alpha.1, v2.0.0-beta.1, or v2.0.0-rc.1 will not trigger Discord notifications, but v2.0.0 will.

File to Modify

  • .github/workflows/build-and-publish.yml - Add the condition to the "Send Notification to Discord" step (around line 260)

Testing Considerations

  • Stable release tags (e.g., v2.0.0) should still send Discord notifications
  • Pre-release tags (e.g., v2.0.0-alpha.1, v2.0.0-beta.1, v2.0.0-rc.1) should NOT send Discord notifications
  • All other workflow functionality should remain unchanged

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…ersions

Co-authored-by: roflmuffin <4160975+roflmuffin@users.noreply.github.com>
Copilot AI changed the title [WIP] Modify Discord notifications for stable releases only Disable Discord notifications for pre-release versions Dec 3, 2025
Copilot AI requested a review from roflmuffin December 3, 2025 03:44
@roflmuffin roflmuffin marked this pull request as ready for review December 3, 2025 03:51
@roflmuffin roflmuffin enabled auto-merge (squash) December 3, 2025 03:51
@roflmuffin roflmuffin disabled auto-merge December 3, 2025 03:51
@roflmuffin roflmuffin merged commit 1a6ff70 into main Dec 3, 2025
15 checks passed
@roflmuffin roflmuffin deleted the copilot/disable-notifications-prerelease branch December 3, 2025 03:52
dollannn pushed a commit to playpark/CounterStrikeSharp that referenced this pull request Dec 6, 2025
…flmuffin#1132)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: roflmuffin <4160975+roflmuffin@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants