Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is pull_request.label available to a Github Action?

I am trying to start a workflow only if the merged pull_request has a specific label.

The merged key is referenced here within an action. The Pull object itself is documented here. But I don't see merged documented by itself or with other keys.

Is pull_request.label available to a Github Action? Is there a comprehensive doc that shows all the keys available to a pull_request?

like image 645
Matt Norris Avatar asked Oct 28 '25 14:10

Matt Norris


1 Answers

To list all labels you can use something like this

       x=${{ toJson(github.event.pull_request.labels.*.name) }}
       echo $x

Also to use a single label you can try

steps:
      - name: deploy        
        if: contains(github.event.pull_request.labels.*.name, 'deploy')      
        run: |
          echo "deploy"
like image 84
pavan Avatar answered Oct 31 '25 13:10

pavan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!