OpenLiberty / liberty-tools-intellij

IntelliJ IDEA extension for Liberty
https://plugins.jetbrains.com/plugin/14856-open-liberty-tools
Eclipse Public License 2.0
11 stars 20 forks source link

Investigate How to Send a Slack Message to Channel if There Are No New, Updated, or Closed PRs in the Current Run. #848

Open vaisakhkannan opened 6 days ago

vaisakhkannan commented 6 days ago

Currently, there is a similar message in the Slack workflow that triggers every cron job, even if there are no new, updated, or closed PRs to list.

Message displaying now as shown in the image

Screenshot 2024-06-28 at 12 12 14 PM
vaisakhkannan commented 6 days ago

If we need to display an alternate message when there are no new, updated, or closed PRs to list, there are some options available now.

  1. Check within the GHA workflow file. If there are no new/updated/closed PRs, then display a message in Slack saying, “There are no new/updated/closed PRs today. Make sure to check the previous cron job PR notifications.”

  2. If we plan to edit messages regularly (e.g., tagging someone to check the PR), the best way is to create another Slack Workflow Builder in Slack with a different Webhook URL, which needs to be added as a secret. Then create a job/step in the GHA workflow to check whether new/updated/closed PRs are present. If they are, trigger one Slack Workflow Builder, and if not, trigger another Slack Workflow Builder. This way, we can edit messages at any time in Slack Workflow Builder without needing to edit the GHA workflow file.

  3. Check the possibility of taking input parameters from the GHA workflow and using the parameters to trigger the appropriate workflow based on the condition.

cc: @TrevCraw

TrevCraw commented 11 hours ago

Hi @vaisakhkannan , thank you for providing some options for design. After discussing with @mrglavas and @turkeylurkey , we felt option 2 or 3 would be good, whichever is easier to implement.