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?
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With