slack-github-action icon indicating copy to clipboard operation
slack-github-action copied to clipboard

Triggering the action based on the Label on the Issue

Open meolivar opened this issue 3 years ago • 1 comments

Description

I am looking for a solution where the github action can only be triggered based on the label associated to the issue created in Github.

The use case is we are trying to trigger the workflow to send a message to slack based on a specific label attached to the issue.

What type of issue is this? (place an x in one of the [ ])

  • [ ] bug
  • [ ] enhancement (feature request)
  • [x] question
  • [ ] documentation related
  • [ ] example code related
  • [ ] testing related
  • [ ] discussion

Requirements (place an x in each of the [ ])

  • [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [x] I've read and agree to the Code of Conduct.
  • [x] I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

package version:

node version:

OS version(s):

Steps to reproduce:

Expected result:

What you expected to happen

Actual result:

What actually happened

Attachments:

Logs, screenshots, screencast, sample project, funny gif, etc.

meolivar avatar Dec 19 '22 22:12 meolivar

Hi @meolivar,

It sounds like you might want to try configuring this workflow action to be triggered by the issues event payload with the activity type labeled. Github docs on that here are very helpful and contain some setup configuration which you can add to your workflow.

on: 
   issues: 
       types: [labeled, unlabeled]

srajiang avatar Dec 19 '22 22:12 srajiang

👋 An example workflow showcasing this and a few more steps with slackapi/slack-github-action@v2 is now included!

zimeg avatar Dec 20 '24 00:12 zimeg