Let's say I have a github action like this:
name: My Action
on:
pull_request:
types:
- closed
jobs:
myjob:
runs-on: ubuntu-latest
name: Test
if: github.event.pull_request.merged && XXX
I would like to have a condition here to test the presence of a label.
From the docs, using contains( github.event.pull_request.labels, 'my_label')
doesn't seem appropriate since it's a dictionary and not an array.
Is there any way around this?
One way to test Github actions is to create a private repo, and iterate the actions conf there. So you can avoid polluting the actual repo with broken commits.
With GitHub Actions, you can trigger CI/CD workflows and pipelines of webhooks from these apps (even something simple, like a chat app message, if you've integrated your chat app into your GitHub repository, of course).
ID is used as a reference, from other jobs or steps (for example, in jobs. <job_id>. needs ). Name is used for display purposes on GitHub.
Finally found it:
contains( github.event.pull_request.labels.*.name, 'My Label')
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