Labeled action on pull_request #25394
-
For the life of me I cannot figure this out. What exactly is value of github.event.pull_request.labels? Based on the developer guide, it should be an array of objects, but here, it prints Array, and no matter how I try to loop it in Bash, it prints Array. Is it literally the string “Array”? So how do I find out specific labels that have been applied to a specific pull request?
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
If you use this step to output the entire github context you can see what the JSON looks like.
I ran it for a PR with two labels and the context output looks like this.
|
Beta Was this translation helpful? Give feedback.
-
Thanks… I’ve been trying so hard to loop it as is but to no avail. Do I have to run toJSON() to be able to interact with it? Even the normal bash syntax to access the values such as |
Beta Was this translation helpful? Give feedback.
-
This question/answer might help you. https://stackoverflow.com/questions/59588605/how-to-check-for-a-label-in-a-github-action-condition |
Beta Was this translation helpful? Give feedback.
-
Hello. I’ve tried the solution given in slackoverflow above, but couldn’t get the label name. my-actions.yaml
and gets
|
Beta Was this translation helpful? Give feedback.
-
Sorry, I solved it myself…
|
Beta Was this translation helpful? Give feedback.
If you use this step to output the entire github context you can see what the JSON looks like.
I ran it for a PR with two labels and the context output looks like this.