travis-ci / travis-conditions

Boolean language for conditional builds, stages, jobs
MIT License
20 stars 4 forks source link

Add github labels #19

Open delijah opened 5 years ago

delijah commented 5 years ago

We would like use conditions for github labels like this: if: 'my-custom-github-label' IN labels

Any chance to inlcude this?

mbrotos commented 2 years ago

My method of fetching github label using Github CLI:

First set GH_TOKEN or GH_ENTERPRISE_TOKEN (and GH_HOST in this case). Then,

gh pr view $TRAVIS_PULL_REQUEST --json labels --jq '.labels[].name'

This can then be used in conditional logic.