Skip to content

Auto-respond on specific label #25062

Answered by weide-zhou
Andre601 asked this question in Actions
Discussion options

You must be logged in to vote

Firstly you need to trigger the workflow with ‘issue’ event, get the new label name from context value ‘${{ github.event.label.name }}’, according to the label name, determin the respond then.

For instance, below code will check if new label ‘bug’ is added and respond accordingly. Hope it helps!

name: labelrespond
on:
    issues:
        types: labeled

jobs:
issuelabel:
runs-on: [ubuntu-latest]
steps:
- name: get labels name
if: contains(github.event.label.name, 'bug' )
run: |
echo ${{ github.event.label.name }}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants