travis-ci / travis-conditions

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

Provide separate owner and repository name variables #28

Open ZryletTC opened 4 years ago

ZryletTC commented 4 years ago

I'm trying to set up a build configuration for multiple repositories using Doctr and would like the job to only run if the deploy key environment variable is defined. The name of this key is of the form DOCTR_DEPLOY_ENCRYPTION_KEY_<OWNER>_<REPONAME> so I would be able to check this using a condition if I had independent access to the owner and repositories names as I could use env(concat("blahlblahblah",env(OWNER),"_",env(REPONAME))) however I cannot seem to find these variables in the Travis documentation. I've only seen repo and TRAVIS_REPO_SLUG which return the full slug, which I can't work with.

Other (more complicated but more enhancement-like) solutions could be addition of a substitution function to travis-conditions or the ability to use regex within the env function.

TLDR: Can owner and repository variables, either as condition attributes or as environment variables, please be added? Or maybe they do exist and I must've skipped over them.